def test_primary_key_is_inherited():
 t = table.Table([(2, 3, 2, 1), (8, 7, 6, 5)], names=('a', 'b'))
 t.add_index('a')
 original_key = t.primary_key
 assert (original_key[0] is 'a')
 t2 = t[:]
 t3 = t.copy()
 t4 = table.Table(t)
 assert (original_key == t2.primary_key)
 assert (original_key == t3.primary_key)
 assert (original_key == t4.primary_key)
 assert (t.loc[1] == t2.loc[1])
 assert (t.loc[1] == t3.loc[1])
 assert (t.loc[1] == t4.loc[1])

def test_primary_key_is_inherited ( ) : t = table . Table ( [ ( 2 , 3 , 2 , 1 ) , ( 8 , 7 , 6 , 5 ) ] , names = ( 'a' , 'b' ) ) t . add_index ( 'a' ) original_key = t . primary_key assert ( original_key [ 0 ] is 'a' ) t2 = t [ : ] t3 = t . copy ( ) t4 = table . Table ( t ) assert ( original_key == t2 . primary_key ) assert ( original_key == t3 . primary_key ) assert ( original_key == t4 . primary_key ) assert ( t . loc [ 1 ] == t2 . loc [ 1 ] ) assert ( t . loc [ 1 ] == t3 . loc [ 1 ] ) assert ( t . loc [ 1 ] == t4 . loc [ 1 ] )
test whether a new table inherits the primary_key attribute from its parent table .