From 799037f02ccdd62a0cddc3b32056dbc62d295fd2 Mon Sep 17 00:00:00 2001 From: Josh Humphries Date: Wed, 11 Dec 2024 19:00:10 +0000 Subject: [PATCH] test: fix the tests after the most recent changes --- tests/emu/views/test_mss.py | 5 ++++- tests/emu/views/test_preparation.py | 12 ++++++++++++ tests/emu/views/test_specimens.py | 2 +- tests/test_config.py | 1 + 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/tests/emu/views/test_mss.py b/tests/emu/views/test_mss.py index 3ab746f..202eee9 100644 --- a/tests/emu/views/test_mss.py +++ b/tests/emu/views/test_mss.py @@ -40,6 +40,7 @@ def test_transform(mss_view: MSSView): "width": 6638, "height": 10199, "orientation": "Horizontal (normal)", + "old_asset_id": "0d5f124013467e40307c6e0dc7595cd92d25b907", "derivatives": [ {"file": "BM000019319.thumb.jpg", "width": 59, "height": 90}, {"file": "BM000019319.120x10199.jpeg", "width": 120, "height": 184}, @@ -67,6 +68,8 @@ def test_transform_no_derivatives(mss_view: MSSView): "file": "BM000019319.tif", "width": 6638, "height": 10199, + "old_asset_id": "0d5f124013467e40307c6e0dc7595cd92d25b907", + "orientation": "Horizontal (normal)", } @@ -76,7 +79,7 @@ def test_transform_no_orientation(mss_view: MSSView): # the associated tag and tag name bits EMu exports) for field in ["ExiTag", "ExiName", "ExiValue"]: # in the test data the orientation tag is the 8th element of the exif lists - del data[field][8] + data[field] = tuple(v for i, v in enumerate(data[field]) if i != 8) record = SourceRecord(SAMPLE_IMAGE_ID, data, "test") data = mss_view.transform(record) diff --git a/tests/emu/views/test_preparation.py b/tests/emu/views/test_preparation.py index 48c7a71..cc695b8 100644 --- a/tests/emu/views/test_preparation.py +++ b/tests/emu/views/test_preparation.py @@ -93,6 +93,8 @@ def test_transform_mol_prep(preparation_view: PreparationView): "preparationType": "DNA Extract", "preparationContents": "**OTHER_SOMATIC_ANIMAL_TISSUE**", "preparationDate": "2022-05-09", + "occurrenceID": "f11c9c35-4da5-45e5-9dbb-6f8f55b26aa7", + "purpose": "DNA barcoding only", } @@ -110,6 +112,8 @@ def test_transform_mammal_part(preparation_view: PreparationView): "identifier": "FF06063966", "preparationProcess": "Flash Freezing: Dry Ice", "preparationContents": "MUSCLE", + "occurrenceID": "541cb421-2a3f-4699-ad3b-8030f36afffa", + "purpose": "DNA barcoding only", } @@ -140,6 +144,8 @@ def test_transform_mol_prep_with_voucher_direct( "decimalLatitude": "10.0833333", "decimalLongitude": "35.6333333", "locality": "Forward base three, Mouth of Didessa River, Blue Nile Gorge, Ethiopia, Alt. 900 m", + "occurrenceID": "f11c9c35-4da5-45e5-9dbb-6f8f55b26aa7", + "purpose": "DNA barcoding only", } @@ -177,6 +183,8 @@ def test_transform_mol_prep_with_voucher_indirect( "decimalLatitude": "10.0833333", "decimalLongitude": "35.6333333", "locality": "Forward base three, Mouth of Didessa River, Blue Nile Gorge, Ethiopia, Alt. 900 m", + "occurrenceID": "f11c9c35-4da5-45e5-9dbb-6f8f55b26aa7", + "purpose": "DNA barcoding only", } @@ -208,6 +216,8 @@ def test_transform_mammal_part_with_voucher_direct( "decimalLatitude": "10.0833333", "decimalLongitude": "35.6333333", "locality": "Forward base three, Mouth of Didessa River, Blue Nile Gorge, Ethiopia, Alt. 900 m", + "occurrenceID": "541cb421-2a3f-4699-ad3b-8030f36afffa", + "purpose": "DNA barcoding only", } @@ -244,6 +254,8 @@ def test_transform_mammal_part_with_voucher_indirect( "decimalLatitude": "10.0833333", "decimalLongitude": "35.6333333", "locality": "Forward base three, Mouth of Didessa River, Blue Nile Gorge, Ethiopia, Alt. 900 m", + "occurrenceID": "541cb421-2a3f-4699-ad3b-8030f36afffa", + "purpose": "DNA barcoding only", } diff --git a/tests/emu/views/test_specimens.py b/tests/emu/views/test_specimens.py index 6e3a3ac..4820c69 100644 --- a/tests/emu/views/test_specimens.py +++ b/tests/emu/views/test_specimens.py @@ -248,7 +248,7 @@ def test_transform_with_linked_data( "superfamily": "Chalcidoidea", "taxonRank": "Species", # added via the mammal part link - "preparations": ["Skull"], + "preparations": "Skull", # added via the gbif link "gbifID": "100", "gbifIssue": issues, diff --git a/tests/test_config.py b/tests/test_config.py index 3c7ffba..09162ce 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -85,6 +85,7 @@ def test_valid(self, tmp_path: Path): artefact_id: 'artefact' indexlot_id: 'indexlot' preparation_id: 'preparation' +sg_prefix: 'test' iiif_base_url: 'https://not.a.real.domain.com/media' elasticsearch: hosts: