Exemplo n.º 1
0
def test_method_phu_set_key_val_7():
    ad = AstroData(TESTFILE2)
    with pytest.raises(AstroDataError):
        assert ad.phu_set_key_value('FOO', None)
Exemplo n.º 2
0
def test_method_phu_set_key_val_3():
    ad = AstroData(TESTFILE2)
    ad.phu_set_key_value('CRVAL1', 1.0)
    assert isinstance(ad.phu.header['CRVAL1'], float)
Exemplo n.º 3
0
def test_method_phu_set_key_val_4():
    ad = AstroData(TESTFILE2)
    test_comment = "This is a TESTKEY"
    ad.phu_set_key_value('TESTKEY', 'TESTVALUE', comment=test_comment)
    assert ad.phu.header.cards['TESTKEY'].comment.endswith(test_comment)
Exemplo n.º 4
0
def test_method_phu_set_key_val_1():
    ad = AstroData(TESTFILE2)
    test_val = 'TESTVALUE'
    ad.phu_set_key_value('TESTKEY', test_val)
    assert ad.phu.header['TESTKEY'] == test_val
Exemplo n.º 5
0
def test_method_phu_set_key_val_2():
    ad = AstroData(TESTFILE2)
    ad.phu_set_key_value('BITPIX', 999)
    assert isinstance(ad.phu.header['BITPIX'], int)
    assert ad.phu.header['BITPIX'] == 999
Exemplo n.º 6
0
def test_method_phu_set_key_val_7():
    ad = AstroData(TESTFILE2)
    with pytest.raises(AstroDataError):
        assert ad.phu_set_key_value('FOO', None)
Exemplo n.º 7
0
def test_method_phu_set_key_val_4():
    ad = AstroData(TESTFILE2)
    test_comment = "This is a TESTKEY"
    ad.phu_set_key_value('TESTKEY', 'TESTVALUE', comment=test_comment)
    assert ad.phu.header.cards['TESTKEY'].comment.endswith(test_comment)
Exemplo n.º 8
0
def test_method_phu_set_key_val_3():
    ad = AstroData(TESTFILE2)
    ad.phu_set_key_value('CRVAL1', 1.0)
    assert isinstance(ad.phu.header['CRVAL1'], float)
Exemplo n.º 9
0
def test_method_phu_set_key_val_2():
    ad = AstroData(TESTFILE2)
    ad.phu_set_key_value('BITPIX', 999)
    assert isinstance(ad.phu.header['BITPIX'], int)
    assert ad.phu.header['BITPIX'] == 999
Exemplo n.º 10
0
def test_method_phu_set_key_val_1():
    ad = AstroData(TESTFILE2)
    test_val = 'TESTVALUE'
    ad.phu_set_key_value('TESTKEY', test_val)
    assert ad.phu.header['TESTKEY'] == test_val