#NEWLINE# def test_N_with_schema( self ) : #NEWLINE# #INDENT# actual_data = N ( SimpleTestSchema , _id = '123' , nest_3__double = 999.999 , extra = { #NEWLINE# #INDENT# 'nest-1__nest-2__string' : 'abcdef' , #NEWLINE# 'nest-1__integer' : 10000 , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( set ( actual_data . keys ( ) ) , set ( SimpleTestSchema . schema . keys ( ) ) . union ( set ( [ '_id' ] ) ) ) #NEWLINE# self . assertEqual ( actual_data [ '_id' ] , '123' ) #NEWLINE# self . assertTrue ( ( 0 <= len ( actual_data [ 'array' ] ) <= 10 ) ) #NEWLINE# self . assertTrue ( all ( [ isinstance ( i , int ) for i in actual_data [ 'array' ] ] ) ) #NEWLINE# self . assertEqual ( set ( actual_data [ 'nest-1' ] . keys ( ) ) , set ( SimpleTestSchema . schema [ 'nest-1' ] . keys ( ) ) ) #NEWLINE# self . assertEqual ( actual_data [ 'nest-1' ] [ 'integer' ] , 10000 ) #NEWLINE# self . assertEqual ( set ( actual_data [ 'nest-1' ] [ 'nest-2' ] . keys ( ) ) , set ( SimpleTestSchema . schema [ 'nest-1' ] [ 'nest-2' ] . keys ( ) ) ) #NEWLINE# self . assertEqual ( actual_data [ 'nest-1' ] [ 'nest-2' ] [ 'string' ] , 'abcdef' ) #NEWLINE# self . assertEqual ( actual_data [ 'nest_3' ] [ 'double' ] , 999.999 )