Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix single test broken by the ref cleanup #443

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading