#NEWLINE# def test_tupleness( self ) : #NEWLINE# #INDENT# Point = namedtuple ( 'Point' , 'x y' ) #NEWLINE# p = Point ( 11 , 22 ) #NEWLINE# self . assertIsInstance ( p , tuple ) #NEWLINE# self . assertEqual ( p , ( 11 , 22 ) ) #NEWLINE# self . assertEqual ( tuple ( p ) , ( 11 , 22 ) ) #NEWLINE# self . assertEqual ( list ( x ) , [ 11 , 22 ] ) #NEWLINE# self . assertEqual ( max ( p ) , 22 ) #NEWLINE# self . assertEqual ( max ( * p ) , 22 ) #NEWLINE# ( x , y ) = p #NEWLINE# self . assertEqual ( p , ( x , y ) ) #NEWLINE# self . assertEqual ( ( p [ 0 ] , p [ 1 ] ) , ( 11 , 22 ) ) #NEWLINE# self . assertRaises ( IndexError , p . __getitem__ , 3 ) #NEWLINE# self . assertEqual ( p . x , x ) #NEWLINE# self . assertEqual ( p . y , y ) #NEWLINE# self . assertRaises ( AttributeError , eval , 'p.z' , locals ( ) )