Skip to content

Commit

Permalink
create test for crds meta setting
Browse files Browse the repository at this point in the history
  • Loading branch information
stscieisenhamer committed Oct 26, 2023
1 parent dcb0ee9 commit fc4c4b8
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions romancal/stpipe/tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from astropy.time import Time
from roman_datamodels.datamodels import FlatRefModel, ImageModel
from roman_datamodels.maker_utils import mk_level2_image
from stpipe import crds_client

from romancal.stpipe import RomanPipeline, RomanStep

Expand Down Expand Up @@ -90,3 +91,25 @@ def process(self):

result = LoggingStep().run()
assert any("Splines failed to reticulate" in l for l in result.cal_logs)


@pytest.mark.skipif(
os.environ.get("CI") == "true",
reason=(
"Roman CRDS servers are not currently available outside the internal network"
),
)
def test_crds_meta():
"""Test that context and software versions are set"""
class ReflectStep(RomanStep):
def process(self, input):
return input

im = ImageModel(mk_level2_image(shape=(20, 20)))
im.meta.ref_file.crds.sw_version = 'junkversion'
im.meta.ref_file.crds.context_used = 'junkcontext'

result = ReflectStep.call(im)

assert result.meta.ref_file.crds.sw_version == crds_client.get_svn_version()
assert result.meta.ref_file.crds.context_used == crds_client.get_context_used(result.crds_observatory)

0 comments on commit fc4c4b8

Please sign in to comment.