def test_method_set_key_val_8(): ad = AstroData(TESTFILE) with pytest.raises(AstroDataError): assert ad.set_key_value('BITPIX', 1)
def test_method_set_key_val_6(): ad = AstroData(TESTFILE2) with pytest.raises(TypeError): assert ad.set_key_value('FOO')
def test_method_set_key_val_7(): ad = AstroData(TESTFILE2) with pytest.raises(AstroDataError): assert ad.set_key_value('FOO', None)
def test_method_set_key_val_3(): ad = AstroData(TESTFILE2) ad.set_key_value('CRVAL1', 1.0) assert isinstance(ad.header['CRVAL1'], float)
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)
def test_method_set_key_val_1(): ad = AstroData(TESTFILE2) ad.set_key_value('TESTKEY', 'TESTVALUE') assert ad.header['TESTKEY']
def test_method_set_key_val_2(): ad = AstroData(TESTFILE2) ad.set_key_value('BITPIX', 999) assert isinstance(ad.header['BITPIX'], int)