Skip to content

Commit ea0cc91

Browse files
committed
Add failing test
This tests that the METS file can be parsed when the bogus amdSec is associated with the objects directory of the structMap. It raises the same exception shown in issue #1129.
1 parent bda7c1f commit ea0cc91

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/test_mets.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1216,3 +1216,14 @@ def test_filegrp_sorting_returns_non_default_groups(
12161216
result = mw._sort_filegrps(file_groups)
12171217

12181218
assert [g.attrib["USE"] for g in result] == expected_uses_order
1219+
1220+
1221+
def test_document_ignores_missing_bag_metadata_amdsec_on_the_objects_directory():
1222+
mets_path = "fixtures/mets_with_missing_bag_metadata_amdsec.xml"
1223+
1224+
mw = metsrw.METSDocument.fromfile(mets_path)
1225+
1226+
objects_directory = mw.get_file(
1227+
type="Directory", label="objects", path=None, use=None
1228+
)
1229+
assert not objects_directory.amdsecs

0 commit comments

Comments
 (0)