Skip to content

Commit

Permalink
rcal-920 Update regression test to use assert
Browse files Browse the repository at this point in the history
  • Loading branch information
ddavis-stsci committed Oct 14, 2024
1 parent 94e4f5c commit 9e73b2e
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions romancal/regtest/test_skycell_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,19 @@

from romancal.associations import skycell_asn

def passfail(bool_expr):
"""set pass fail"""
if bool_expr:
return "Pass"
return "Fail"


@pytest.mark.bigdata
def test_skycell_asn_generation(rtdata, ignore_asdf_paths):
def test_skycell_asn_generation(rtdata):
"""Test for the generation of associations based on skycells"""

# This test should generate seven json files
args = ['r0000101001001001001_01101_0002_WFI01_cal.asdf', \
'r0000101001001001001_01101_0002_WFI10_cal.asdf', '-o', 'r512']
#rtdata.get_asn("WFI/image/L3_regtest_asn.json")
rtdata.get_data("WFI/image/r0000101001001001001_01101_0002_WFI01_cal.asdf")
rtdata.get_data("WFI/image/r0000101001001001001_01101_0002_WFI10_cal.asdf")

skycell_asn.Main(args)

# skycell associations that should be generated
output_files = ['r512_r274dp63x31y80_visit_F158_prompt_i2d_asn.json',
'r512_r274dp63x31y81_visit_F158_prompt_i2d_asn.json',
'r512_r274dp63x31y82_visit_F158_prompt_i2d_asn.json',
Expand All @@ -35,7 +28,5 @@ def test_skycell_asn_generation(rtdata, ignore_asdf_paths):
'r512_r274dp63x33y81_visit_F158_prompt_i2d_asn.json']
# Test that the json files exist
for file in output_files:
skycell_asn.logger.info(
"Check that the json file exists "
+ passfail(os.path.isfile(file))
)
skycell_asn.logger.info(f"Check that the json file exists{file}")
assert os.path.isfile(file)

0 comments on commit 9e73b2e

Please sign in to comment.