#NEWLINE# def test_optional_parameter( self ) : #NEWLINE# #INDENT# get = params . parse ( [ ( 'foo' , { #NEWLINE# #INDENT# 'validators' : self . bar_validator , #NEWLINE# 'required' : False , #NEWLINE# #UNINDENT# } ) ] ) ( self . handler . get ) #NEWLINE# get ( self . handler ) #NEWLINE# self . handler . get . assert_called_with ( self . handler , foo = None ) #NEWLINE# self . handler . request . arguments [ 'foo' ] = 'Foobar' #NEWLINE# get ( self . handler ) #NEWLINE# self . bar_validator . validate . assert_called_with ( 'Foobar' , get . handler ) #NEWLINE# self . handler . get . assert_called_with ( self . handler , foo = 'bar' )