Skip to content

Commit

Permalink
test: fix the tests after the most recent changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jrdh committed Dec 11, 2024
1 parent 7994e61 commit 799037f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
5 changes: 4 additions & 1 deletion tests/emu/views/test_mss.py
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down Expand Up @@ -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)",
}


Expand All @@ -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)
Expand Down
12 changes: 12 additions & 0 deletions tests/emu/views/test_preparation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}


Expand All @@ -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",
}


Expand Down Expand Up @@ -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",
}


Expand Down Expand Up @@ -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",
}


Expand Down Expand Up @@ -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",
}


Expand Down Expand Up @@ -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",
}


Expand Down
2 changes: 1 addition & 1 deletion tests/emu/views/test_specimens.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 799037f

Please sign in to comment.