Skip to content

Commit

Permalink
Add test case for empty bag metadata
Browse files Browse the repository at this point in the history
This simulates the scenarios where a bag does not contain a
bag-info.txt and bagit returns an empty dictionary for its info
attribute or when reading the bag goes wrong and the create_mets_v2
script logs the problem but also returns an empty dictionary.

These scenario raise the same exception shown in issue #1129.
  • Loading branch information
replaceafill committed Jan 9, 2025
1 parent a263d89 commit 48aeb77
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/MCPClient/test_create_mets_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,9 +435,11 @@ def bag_path(sip_directory_path: pathlib.Path, sip: SIP) -> pathlib.Path:
"info",
[
{"Bagging-Date": "2025-01-08", "Payload-Oxum": "0.2"},
{},
],
ids=[
"populated",
"empty",
],
)
def test_bag_metadata_is_recorded_in_a_amdsec(
Expand Down

0 comments on commit 48aeb77

Please sign in to comment.