Beispiel #1
0
def test_method_set_key_val_8():
    ad = AstroData(TESTFILE)
    with pytest.raises(AstroDataError):
        assert ad.set_key_value('BITPIX', 1)
Beispiel #2
0
def test_method_set_key_val_6():
    ad = AstroData(TESTFILE2)
    with pytest.raises(TypeError):
        assert ad.set_key_value('FOO')
Beispiel #3
0
def test_method_set_key_val_7():
    ad = AstroData(TESTFILE2)
    with pytest.raises(AstroDataError):
        assert ad.set_key_value('FOO', None)
Beispiel #4
0
def test_method_set_key_val_3():
    ad = AstroData(TESTFILE2)
    ad.set_key_value('CRVAL1', 1.0)
    assert isinstance(ad.header['CRVAL1'], float)
Beispiel #5
0
def test_method_set_key_val_4():
    ad = AstroData(TESTFILE2)
    test_comment = "This is a TESTKEY"
    ad.set_key_value('TESTKEY', 'TESTVALUE', comment=test_comment)
    assert ad.header.cards['TESTKEY'].comment.endswith(test_comment)
Beispiel #6
0
def test_method_set_key_val_1():
    ad = AstroData(TESTFILE2)
    ad.set_key_value('TESTKEY', 'TESTVALUE')
    assert ad.header['TESTKEY']
Beispiel #7
0
def test_method_set_key_val_2():
    ad = AstroData(TESTFILE2)
    ad.set_key_value('BITPIX', 999)
    assert isinstance(ad.header['BITPIX'], int)
Beispiel #8
0
def test_method_set_key_val_7():
    ad = AstroData(TESTFILE2)
    with pytest.raises(AstroDataError):
        assert ad.set_key_value('FOO', None)
Beispiel #9
0
def test_method_set_key_val_8():
    ad = AstroData(TESTFILE)
    with pytest.raises(AstroDataError):
        assert ad.set_key_value('BITPIX', 1)
Beispiel #10
0
def test_method_set_key_val_6():
    ad = AstroData(TESTFILE2)
    with pytest.raises(TypeError):
        assert ad.set_key_value('FOO')
Beispiel #11
0
def test_method_set_key_val_4():
    ad = AstroData(TESTFILE2)
    test_comment = "This is a TESTKEY"
    ad.set_key_value('TESTKEY', 'TESTVALUE', comment=test_comment)
    assert ad.header.cards['TESTKEY'].comment.endswith(test_comment)
Beispiel #12
0
def test_method_set_key_val_3():
    ad = AstroData(TESTFILE2)
    ad.set_key_value('CRVAL1', 1.0)
    assert isinstance(ad.header['CRVAL1'], float)
Beispiel #13
0
def test_method_set_key_val_2():
    ad = AstroData(TESTFILE2)
    ad.set_key_value('BITPIX', 999)
    assert isinstance(ad.header['BITPIX'], int)
Beispiel #14
0
def test_method_set_key_val_1():
    ad = AstroData(TESTFILE2)
    ad.set_key_value('TESTKEY', 'TESTVALUE')
    assert ad.header['TESTKEY']