From 9e73b2ed6517d19af70b2f7bb6fabc56ca5936a7 Mon Sep 17 00:00:00 2001 From: Dave Davis Date: Fri, 4 Oct 2024 16:04:22 -0400 Subject: [PATCH] rcal-920 Update regression test to use assert --- romancal/regtest/test_skycell_generation.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/romancal/regtest/test_skycell_generation.py b/romancal/regtest/test_skycell_generation.py index 226f6f405..9068db195 100644 --- a/romancal/regtest/test_skycell_generation.py +++ b/romancal/regtest/test_skycell_generation.py @@ -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', @@ -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)