Skip to content

Commit

Permalink
Add test that tag and schema versions match for transform manifests (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
braingram authored Mar 19, 2024
1 parent d8d47fc commit 50751a8
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/stdatamodels/jwst/datamodels/tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,19 @@ def test_resource_id(resource):
assert (
resource_manager[schema["id"]] == contents
), f"id[{schema['id']}] for resource[{resource}] did not return the contents of the resource"


@pytest.mark.parametrize("manifest_filename", TRANSFORM_MANIFESTS)
def test_manifest_tag_versions(manifest_filename):
with open(manifest_filename, "rb") as f:
contents = f.read()
manifest = yaml.safe_load(contents.decode("ascii"))

for tag_def in manifest["tags"]:
tag_uri = tag_def["tag_uri"]
tag_name, tag_version = asdf.versioning.split_tag_version(tag_uri)
schema_uri = tag_def["schema_uri"]
schema_name, schema_version = asdf.versioning.split_tag_version(schema_uri)
# although not generally required for stdatamodels transforms all
# tag versions should match schema version
assert tag_version == schema_version

0 comments on commit 50751a8

Please sign in to comment.