Skip to content

Commit

Permalink
Fix single test broken by the ref cleanup
Browse files Browse the repository at this point in the history
This is really a test that ought to be in rad as it concerns the schemas but it is here. The change simple updates the reference to the absolute URI rather than the relative URI
  • Loading branch information
WilliamJamieson committed Dec 30, 2024
1 parent f4c0906 commit d2073fd
Showing 1 changed file with 11 additions and 16 deletions.
27 changes: 11 additions & 16 deletions tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d2073fd

Please sign in to comment.