Skip to content

Commit 60d7cb2

Browse files
EKIR-725 Rename test feed to demarque
1 parent 668b4a3 commit 60d7cb2

6 files changed

Lines changed: 17 additions & 13 deletions

File tree

tests/api/opds/odl/test_odl.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def test__get_publication_type() -> None:
2121
@pytest.mark.parametrize(
2222
"filename",
2323
[
24-
"feed.json",
24+
"demarque_feed.json",
2525
"feed2.json",
2626
"auth_token_feed.json",
2727
],
@@ -50,7 +50,9 @@ def test_feed_odl_failure(
5050
The ODL parser should fail to parse an OPDS2 feed with an ODL publication.
5151
"""
5252
with pytest.raises(ValidationError) as exc_info:
53-
Feed.model_validate_json(opds2_with_odl_files_fixture.sample_data("feed.json"))
53+
Feed.model_validate_json(
54+
opds2_with_odl_files_fixture.sample_data("demarque_feed.json")
55+
)
5456

5557
errors = exc_info.value.errors()
5658
assert len(errors) == 2

tests/api/opds/test_opds2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
"filename, publication_identifiers",
1010
[
1111
pytest.param(
12-
"feed.json",
12+
"demarque_feed.json",
1313
[
1414
"urn:isbn:978-3-16-148410-0",
1515
"http://example.org/huckleberry-finn",
1616
"urn:proquest.com/document-id/181639",
1717
"urn:isbn:9789523565593",
1818
"urn:isbn:978-0-06-112008-4",
1919
],
20-
id="feed.json",
20+
id="demarque_feed.json",
2121
),
2222
pytest.param(
2323
"feed2.json",

tests/api/test_odl2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def test_import(
8989
)
9090

9191
odl_mock_get.add(moby_dick_license)
92-
feed = api_odl_files_fixture.sample_text("feed.json")
92+
feed = api_odl_files_fixture.sample_text("demarque_feed.json")
9393

9494
config = odl2_importer.collection.integration_configuration
9595
odl2_importer.ignored_identifier_types = [IdentifierConstants.URI]
@@ -529,7 +529,7 @@ def test_import_availability(
529529
odl_mock_get: MockGet,
530530
api_odl_files_fixture: ODLAPIFilesFixture,
531531
) -> None:
532-
feed_json = json.loads(api_odl_files_fixture.sample_text("feed.json"))
532+
feed_json = json.loads(api_odl_files_fixture.sample_text("demarque_feed.json"))
533533

534534
moby_dick_license_dict = feed_json["publications"][0]["licenses"][0]
535535
test_book_license_dict = feed_json["publications"][2]["licenses"][0]

tests/core/test_opds2_import.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def test_opds2_importer_correctly_imports_valid_opds2_feed(
143143
opds2_importer_fixture.transaction,
144144
opds2_importer_fixture.transaction.session,
145145
)
146-
content_server_feed_text = opds2_files_fixture.sample_text("feed.json")
146+
content_server_feed_text = opds2_files_fixture.sample_text("demarque_feed.json")
147147
content_server_feed: str | bytes
148148

149149
if manifest_type == "bytes":
@@ -461,8 +461,7 @@ def test_opds2_importer_skips_publications_with_unsupported_identifier_types(
461461
data.importer.ignored_identifier_types = [
462462
t.value for t in ignore_identifier_type
463463
]
464-
print(data.importer.ignored_identifier_types)
465-
content_server_feed = opds2_files_fixture.sample_text("feed.json")
464+
content_server_feed = opds2_files_fixture.sample_text("demarque_feed.json")
466465

467466
# Act
468467
imported_editions, pools, works, failures = data.importer.import_from_feed(
@@ -564,7 +563,10 @@ def test_extract_next_links(
564563
assert extract_next_links(b"garbage") == []
565564

566565
# No next links
567-
assert extract_next_links(opds2_files_fixture.sample_data("feed.json")) == []
566+
assert (
567+
extract_next_links(opds2_files_fixture.sample_data("demarque_feed.json"))
568+
== []
569+
)
568570

569571
# One next link
570572
assert extract_next_links(opds2_files_fixture.sample_data("feed2.json")) == [
@@ -585,7 +587,7 @@ def test_extract_last_update_dates(
585587

586588
# Feed with last update dates
587589
assert extract_last_update_dates(
588-
opds2_files_fixture.sample_data("feed.json")
590+
opds2_files_fixture.sample_data("demarque_feed.json")
589591
) == [
590592
(
591593
"urn:isbn:978-3-16-148410-0",
@@ -620,7 +622,7 @@ def test_opds2_importer_imports_feeds_with_availability_info(
620622
opds2_importer_fixture.transaction,
621623
opds2_importer_fixture.transaction.session,
622624
)
623-
feed_json = json.loads(opds2_files_fixture.sample_text("feed.json"))
625+
feed_json = json.loads(opds2_files_fixture.sample_text("demarque_feed.json"))
624626

625627
moby_dick_metadata = feed_json["publications"][0]["metadata"]
626628
huckleberry_finn_metadata = feed_json["publications"][1]["metadata"]

tests/core/test_opds_validate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class TestOPDS2WithODLValidation:
5353
@pytest.mark.parametrize(
5454
"feed_name, fail",
5555
[
56-
("feed.json", True),
56+
("demarque_feed.json", True),
5757
("feed2.json", False),
5858
],
5959
)

0 commit comments

Comments
 (0)