Skip to content

Commit

Permalink
Move ref_common check to rad from roman_datamodels
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamJamieson committed Jan 13, 2025
1 parent 2338fa6 commit 87b3e12
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/test_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
asdf.schema.load_schema("asdf://stsci.edu/datamodels/roman/schemas/wfi_optical_element-1.0.0")["enum"]
)
EXPOSURE_TYPE_ELEMENTS = list(asdf.schema.load_schema("asdf://stsci.edu/datamodels/roman/schemas/exposure_type-1.0.0")["enum"])
EXPECTED_COMMON_REFERENCE = {"$ref": "asdf://stsci.edu/datamodels/roman/schemas/reference_files/ref_common-1.0.0"}


@pytest.fixture(scope="session", params=SCHEMA_URIS)
Expand Down Expand Up @@ -263,6 +264,19 @@ def test_reftype_tag(ref_file_uris):
assert asdf.util.uri_match(f"asdf://stsci.edu/datamodels/roman/schemas/reference_files/*{reftype}-*", schema_uri)


def test_ref_file_meta_common(ref_file_schema):
"""
Test that the meta for all reference files contains a reference to `ref_common`
"""
all_of = ref_file_schema["properties"]["meta"]["allOf"]

for item in all_of:
if item == EXPECTED_COMMON_REFERENCE:
break
else:
raise ValueError("ref_common not found in meta")


# don't test tvac or fps schemas as they are static
@pytest.mark.parametrize(
"uri",
Expand Down

0 comments on commit 87b3e12

Please sign in to comment.