#NEWLINE# def test_parse_spec( ) : #NEWLINE# #INDENT# ab = thriftpy . load ( 'addressbook.thrift' ) #NEWLINE# cases = [ ( ( TType . I32 , None ) , 'I32' ) , ( ( TType . STRUCT , ab . PhoneNumber ) , 'PhoneNumber' ) , ( ( TType . LIST , TType . I32 ) , 'LIST<I32>' ) , ( ( TType . LIST , ( TType . STRUCT , ab . PhoneNumber ) ) , 'LIST<PhoneNumber>' ) , ( ( TType . MAP , ( TType . STRING , ( TType . LIST , ( TType . MAP , ( TType . STRING , TType . STRING ) ) ) ) ) , 'MAP<STRING, LIST<MAP<STRING, STRING>>>' ) ] #NEWLINE# for ( spec , res ) in cases : #NEWLINE# #INDENT# assert ( parse_spec ( * spec ) == res )