#NEWLINE# def test_factory( self ) : #NEWLINE# #INDENT# Point = namedtuple ( 'Point' , 'x y' ) #NEWLINE# self . assertEqual ( Point . __name__ , 'Point' ) #NEWLINE# self . assertEqual ( Point . __slots__ , ( ) ) #NEWLINE# self . assertEqual ( Point . __module__ , __name__ ) #NEWLINE# self . assertEqual ( nt . __getitem__ , tuple . __getitem__ ) #NEWLINE# self . assertEqual ( Point . _fields , ( 'x' , 'y' ) ) #NEWLINE# self . assertRaises ( ValueError , namedtuple , 'abc%' , 'efg ghi' ) #NEWLINE# self . assertRaises ( ValueError , namedtuple , 'class' , 'efg ghi' ) #NEWLINE# self . assertRaises ( ValueError , namedtuple , '9abc' , 'efg ghi' ) #NEWLINE# self . assertRaises ( ValueError , namedtuple , 'abc' , 'efg g%hi' ) #NEWLINE# self . assertRaises ( ValueError , namedtuple , 'abc' , 'abc class' ) #NEWLINE# self . assertRaises ( ValueError , namedtuple , 'abc' , '8efg 9ghi' ) #NEWLINE# self . assertRaises ( ValueError , namedtuple , 'abc' , '_efg ghi' ) #NEWLINE# self . assertRaises ( ValueError , namedtuple , 'abc' , 'efg efg ghi' ) #NEWLINE# namedtuple ( 'Point0' , 'x1 y2' ) #NEWLINE# namedtuple ( '_' , 'a b c' ) #NEWLINE# nt = namedtuple ( 'nt' , 'the quick brown fox' ) #NEWLINE# self . assertNotIn ( "u'" , repr ( nt . _fields ) ) #NEWLINE# nt = namedtuple ( 'nt' , ( 'the' , 'quick' ) ) #NEWLINE# self . assertNotIn ( "u'" , repr ( nt . _fields ) ) #NEWLINE# self . assertRaises ( TypeError , Point . _make , [ 11 ] ) #NEWLINE# self . assertRaises ( TypeError , Point . _make , [ 11 , 22 , 33 ] )