Beispiel #1
0
def test_string_override():
    dm_ramp, ref_data = create_models()

    step = DQInitStep(override_mask="some_file.fits")

    # Verify stpipe treats string as filename and attempts to open
    with pytest.raises(FileNotFoundError):
        step.get_reference_file(dm_ramp, 'mask')
Beispiel #2
0
def test_valid_model_override():
    dm_ramp, ref_data = create_models()

    step = DQInitStep(override_mask=ref_data)

    # Verify get_reference_file() returns an override model.
    fetched_reference = step.get_reference_file(dm_ramp, 'mask')
    assert isinstance(fetched_reference, MaskModel), \
        "get_reference_file() should return a model for this override."

    # Verify no exceptions occur during DQ processing.
    step.process(dm_ramp)
Beispiel #3
0
def test_invalid_override():
    """Test that a bogus override type is caught."""
    dm_ramp, ref_data = create_models()

    with pytest.raises(ValidationError):
        DQInitStep(override_mask=DQInitStep)