#NEWLINE# def test_bad_create_config_from_post( tmpdir ) : #NEWLINE# #INDENT# workspace = tmpdir . strpath #NEWLINE# temp_config_path = ( workspace + '/config.yaml' ) #NEWLINE# bad_post_data = { #NEWLINE# #INDENT# 'agent_list' : 'foo' , #NEWLINE# 'master_list' : [ 'foo' ] , #NEWLINE# #UNINDENT# } #NEWLINE# expected_bad_messages = { #NEWLINE# #INDENT# 'agent_list' : 'agent_list must be a list' , #NEWLINE# 'master_list' : 'Only IPv4 values are allowed. The following are invalid IPv4 addresses: foo' , #NEWLINE# #UNINDENT# } #NEWLINE# ( err , msg ) = backend . create_config_from_post ( post_data = bad_post_data , config_path = temp_config_path ) #NEWLINE# assert ( err is True ) #NEWLINE# assert ( msg == expected_bad_messages )