#NEWLINE# def test_optional( self ) : #NEWLINE# #INDENT# spec = { #NEWLINE# #INDENT# 'foo' : 'optional' , #NEWLINE# 'bar' : 'optional' , #NEWLINE# #UNINDENT# } #NEWLINE# self . assertEquals ( None , validation . validate ( spec , { #NEWLINE# #INDENT# 'foo' : 'Foo' , #NEWLINE# 'bar' : 'Bar' , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# self . assertRaises ( validation . BadArgumentError , validation . validate , spec , { #NEWLINE# #INDENT# 'hoi' : 'Hoi' , #NEWLINE# 'foo' : 'Foo' , #NEWLINE# 'bar' : 'Bar' , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEquals ( None , validation . validate ( spec , { #NEWLINE# #INDENT# 'foo' : 'Foo' , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# self . assertEquals ( None , validation . validate ( spec , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) )