def test_shallow_copy():
 original_header = fits.Header([('a', 1), ('b', 1)])
 copied_header = copy.copy(original_header)
 original_header['c'] = 100
 assert ('c' not in copied_header)
 copied_header['a'] = 0
 assert (original_header['a'] == 1)

def test_shallow_copy ( ) : original_header = fits . Header ( [ ( 'a' , 1 ) , ( 'b' , 1 ) ] ) copied_header = copy . copy ( original_header ) original_header [ 'c' ] = 100 assert ( 'c' not in copied_header ) copied_header [ 'a' ] = 0 assert ( original_header [ 'a' ] == 1 )
make sure that operations on a shallow copy do not alter the original .