Skip to content

Commit 799037f

Browse files
committed
test: fix the tests after the most recent changes
1 parent 7994e61 commit 799037f

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

tests/emu/views/test_mss.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def test_transform(mss_view: MSSView):
4040
"width": 6638,
4141
"height": 10199,
4242
"orientation": "Horizontal (normal)",
43+
"old_asset_id": "0d5f124013467e40307c6e0dc7595cd92d25b907",
4344
"derivatives": [
4445
{"file": "BM000019319.thumb.jpg", "width": 59, "height": 90},
4546
{"file": "BM000019319.120x10199.jpeg", "width": 120, "height": 184},
@@ -67,6 +68,8 @@ def test_transform_no_derivatives(mss_view: MSSView):
6768
"file": "BM000019319.tif",
6869
"width": 6638,
6970
"height": 10199,
71+
"old_asset_id": "0d5f124013467e40307c6e0dc7595cd92d25b907",
72+
"orientation": "Horizontal (normal)",
7073
}
7174

7275

@@ -76,7 +79,7 @@ def test_transform_no_orientation(mss_view: MSSView):
7679
# the associated tag and tag name bits EMu exports)
7780
for field in ["ExiTag", "ExiName", "ExiValue"]:
7881
# in the test data the orientation tag is the 8th element of the exif lists
79-
del data[field][8]
82+
data[field] = tuple(v for i, v in enumerate(data[field]) if i != 8)
8083
record = SourceRecord(SAMPLE_IMAGE_ID, data, "test")
8184

8285
data = mss_view.transform(record)

tests/emu/views/test_preparation.py

+12
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ def test_transform_mol_prep(preparation_view: PreparationView):
9393
"preparationType": "DNA Extract",
9494
"preparationContents": "**OTHER_SOMATIC_ANIMAL_TISSUE**",
9595
"preparationDate": "2022-05-09",
96+
"occurrenceID": "f11c9c35-4da5-45e5-9dbb-6f8f55b26aa7",
97+
"purpose": "DNA barcoding only",
9698
}
9799

98100

@@ -110,6 +112,8 @@ def test_transform_mammal_part(preparation_view: PreparationView):
110112
"identifier": "FF06063966",
111113
"preparationProcess": "Flash Freezing: Dry Ice",
112114
"preparationContents": "MUSCLE",
115+
"occurrenceID": "541cb421-2a3f-4699-ad3b-8030f36afffa",
116+
"purpose": "DNA barcoding only",
113117
}
114118

115119

@@ -140,6 +144,8 @@ def test_transform_mol_prep_with_voucher_direct(
140144
"decimalLatitude": "10.0833333",
141145
"decimalLongitude": "35.6333333",
142146
"locality": "Forward base three, Mouth of Didessa River, Blue Nile Gorge, Ethiopia, Alt. 900 m",
147+
"occurrenceID": "f11c9c35-4da5-45e5-9dbb-6f8f55b26aa7",
148+
"purpose": "DNA barcoding only",
143149
}
144150

145151

@@ -177,6 +183,8 @@ def test_transform_mol_prep_with_voucher_indirect(
177183
"decimalLatitude": "10.0833333",
178184
"decimalLongitude": "35.6333333",
179185
"locality": "Forward base three, Mouth of Didessa River, Blue Nile Gorge, Ethiopia, Alt. 900 m",
186+
"occurrenceID": "f11c9c35-4da5-45e5-9dbb-6f8f55b26aa7",
187+
"purpose": "DNA barcoding only",
180188
}
181189

182190

@@ -208,6 +216,8 @@ def test_transform_mammal_part_with_voucher_direct(
208216
"decimalLatitude": "10.0833333",
209217
"decimalLongitude": "35.6333333",
210218
"locality": "Forward base three, Mouth of Didessa River, Blue Nile Gorge, Ethiopia, Alt. 900 m",
219+
"occurrenceID": "541cb421-2a3f-4699-ad3b-8030f36afffa",
220+
"purpose": "DNA barcoding only",
211221
}
212222

213223

@@ -244,6 +254,8 @@ def test_transform_mammal_part_with_voucher_indirect(
244254
"decimalLatitude": "10.0833333",
245255
"decimalLongitude": "35.6333333",
246256
"locality": "Forward base three, Mouth of Didessa River, Blue Nile Gorge, Ethiopia, Alt. 900 m",
257+
"occurrenceID": "541cb421-2a3f-4699-ad3b-8030f36afffa",
258+
"purpose": "DNA barcoding only",
247259
}
248260

249261

tests/emu/views/test_specimens.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ def test_transform_with_linked_data(
248248
"superfamily": "Chalcidoidea",
249249
"taxonRank": "Species",
250250
# added via the mammal part link
251-
"preparations": ["Skull"],
251+
"preparations": "Skull",
252252
# added via the gbif link
253253
"gbifID": "100",
254254
"gbifIssue": issues,

tests/test_config.py

+1
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ def test_valid(self, tmp_path: Path):
8585
artefact_id: 'artefact'
8686
indexlot_id: 'indexlot'
8787
preparation_id: 'preparation'
88+
sg_prefix: 'test'
8889
iiif_base_url: 'https://not.a.real.domain.com/media'
8990
elasticsearch:
9091
hosts:

0 commit comments

Comments
 (0)