From 8dd30a514edbe1cd1d85481781b2e5a20f1017bd Mon Sep 17 00:00:00 2001 From: William Jamieson Date: Thu, 9 Jan 2025 09:37:59 -0500 Subject: [PATCH] Fix single test broken by the ref cleanup (#443) --- tests/test_models.py | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/tests/test_models.py b/tests/test_models.py index 14a5e601..a1f38a02 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -16,7 +16,7 @@ from .conftest import MANIFEST -EXPECTED_COMMON_REFERENCE = {"$ref": "ref_common-1.0.0"} +EXPECTED_COMMON_REFERENCE = {"$ref": "asdf://stsci.edu/datamodels/roman/schemas/reference_files/ref_common-1.0.0"} # Nodes for metadata schema that do not contain any archive_catalog keywords NODES_LACKING_ARCHIVE_CATALOG = [ @@ -322,21 +322,16 @@ def test_make_guidewindow(): # Testing all reference file schemas -def test_reference_file_model_base(tmp_path): - # Set temporary asdf file - - # Get all reference file classes - tags = [t for t in stnode.NODE_EXTENSIONS[0].tags if "/reference_files/" in t.tag_uri] - for tag in tags: - schema = asdf.schema.load_schema(tag.schema_uris[0]) - # Check that schema references common reference schema - allofs = schema["properties"]["meta"]["allOf"] - found_common = False - for item in allofs: - if item == EXPECTED_COMMON_REFERENCE: - found_common = True - if not found_common: - raise ValueError("Reference schema does not include ref_common") # pragma: no cover +@pytest.mark.parametrize("tag", [t for t in stnode.NODE_EXTENSIONS[0].tags if "/reference_files/" in t.tag_uri]) +def test_reference_file_model_base(tag): + schema = asdf.schema.load_schema(tag.schema_uris[0]) + # Check that schema references common reference schema + allofs = schema["properties"]["meta"]["allOf"] + for item in allofs: + if item == EXPECTED_COMMON_REFERENCE: + break + else: + raise ValueError("Reference schema does not include ref_common") # pragma: no cover # AB Vega Offset Correction tests