#NEWLINE# def test_set_flat_scalar( ) : #NEWLINE# #INDENT# pairs = [ ( 'l' , '1' ) ] #NEWLINE# schema = List . named ( 'l' ) . of ( Integer . named ( 'i' ) ) #NEWLINE# el = schema ( ) #NEWLINE# canary = [ ] #NEWLINE# def setter( self , value ) : #NEWLINE# #INDENT# canary . append ( value ) #NEWLINE# return type ( el ) . set ( self , value ) #NEWLINE# #UNINDENT# el . set = setter . __get__ ( el , type ( el ) ) #NEWLINE# el . set_flat ( pairs ) #NEWLINE# eq_ ( len ( el ) , 0 ) #NEWLINE# eq_ ( el . value , [ ] ) #NEWLINE# eq_ ( canary , [ ] )