diff --git a/tests/manager/celery/tasks/test_marc.py b/tests/manager/celery/tasks/test_marc.py index f3ccc40ee..9516b6e9c 100644 --- a/tests/manager/celery/tasks/test_marc.py +++ b/tests/manager/celery/tasks/test_marc.py @@ -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 ) @@ -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 diff --git a/tests/manager/marc/test_exporter.py b/tests/manager/marc/test_exporter.py index 76a0b1b4b..cde6c8693 100644 --- a/tests/manager/marc/test_exporter.py +++ b/tests/manager/marc/test_exporter.py @@ -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