def test_is_tso_nrcgrism_nints1(): """Test is_tso with NRC_TSGRISM and NINTS=1""" model = datamodels.JwstDataModel() model.meta.exposure.type = "NRC_TSGRISM" model.meta.visit.tsovisit = False model.meta.exposure.nints = 10 # with NINTS>1, should be True assert pipe_utils.is_tso(model) # with NINTS=1, should be False model.meta.exposure.nints = 1 assert not pipe_utils.is_tso(model) # with hardwired TSO EXP_TYPE's, should always be True assert (is_tso(model) or model.meta.exposure.type.lower() in ['nrc_tsimage', 'nrc_tsgrism'])
def test_is_tso_from_tsoflag(tsovisit, expected): """Test is_tso integrity based on the TSO flag""" model = datamodels.JwstDataModel() model.meta.visit.tsovisit = tsovisit assert pipe_utils.is_tso(model) is expected
def test_is_tso_from_exptype(exp_type, expected): """Test is_tso integrity based on exp_type""" model = datamodels.JwstDataModel() model.meta.exposure.type = exp_type.upper() assert pipe_utils.is_tso(model) is expected