Skip to content

Commit

Permalink
Mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathangreen committed Oct 29, 2024
1 parent dccdb61 commit fbb4c93
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 5 additions & 1 deletion tests/manager/celery/tasks/test_marc.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ def export_collection(self, collection: Collection, delta: bool = False) -> None
).wait()

def redis_lock(self, collection: Collection, delta: bool = False) -> RedisLock:
assert collection.id is not None
return marc_export_collection_lock(
self.redis_fixture.client, collection.id, delta=delta
)
Expand Down Expand Up @@ -270,12 +271,15 @@ def test_normal_run(
marc_files = marc_export_collection_fixture.marc_files()
assert len(marc_files) == 4
delta_marc_files = [
marc_file for marc_file in marc_files if "delta" in marc_file.key
marc_file
for marc_file in marc_files
if marc_file.key and "delta" in marc_file.key
]
assert len(delta_marc_files) == 2

# Verify that the marc files contain the expected works.
for marc_file in delta_marc_files:
assert marc_file.key is not None
data = s3_service_integration_fixture.get_object("public", marc_file.key)
records = list(MARCReader(data))
assert len(records) == 2
Expand Down
8 changes: 4 additions & 4 deletions tests/manager/marc/test_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,13 +395,13 @@ def test_process_work(self, marc_exporter_fixture: MarcExporterFixture) -> None:
)

# We get both libraries included in a full record
processed = process_work(False)
assert list(processed.keys()) == enabled_libraries
processed_works = process_work(False)
assert list(processed_works.keys()) == enabled_libraries

# But we only get library1 in a delta record, since this is the first full marc export
# for library2, so there is no timestamp to create a delta record against.
[processed] = process_work(True).keys()
assert processed.library_id == marc_exporter_fixture.library1.id
[processed_work] = process_work(True).keys()
assert processed_work.library_id == marc_exporter_fixture.library1.id

def test_files_for_cleanup_deleted_disabled(
self, marc_exporter_fixture: MarcExporterFixture
Expand Down

0 comments on commit fbb4c93

Please sign in to comment.