#NEWLINE# def test_complex_schemas( ) : #NEWLINE# #INDENT# BASIC_TYPES = ( Integer , Float , String , Boolean ) #NEWLINE# LIST_TYPES = [ List ( bt ) for bt in BASIC_TYPES ] #NEWLINE# MAP_TYPES = [ ] #NEWLINE# ENUM_TYPES = [ Enum ( ) , Enum ( 'Red' , 'Green' , 'Blue' ) , Enum ( 'Animals' , ( 'Dog' , 'Cat' ) ) ] #NEWLINE# for typ1 in BASIC_TYPES : #NEWLINE# #INDENT# for typ2 in BASIC_TYPES : #NEWLINE# #INDENT# MAP_TYPES . append ( Map ( typ1 , LIST_TYPES ) ) #NEWLINE# #UNINDENT# #UNINDENT# for mt1 in ( BASIC_TYPES , LIST_TYPES , MAP_TYPES , ENUM_TYPES ) : #NEWLINE# #INDENT# for mt2 in ( BASIC_TYPES , LIST_TYPES , MAP_TYPES , ENUM_TYPES ) : #NEWLINE# #INDENT# for typ1 in mt1 : #NEWLINE# #INDENT# for typ2 in mt2 : #NEWLINE# #INDENT# assert isinstance ( TypeFactory . new ( { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , * Map ( typ1 , typ2 ) . serialize_type ( ) ) ( { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) , Map ( typ1 , typ2 ) )