def test_good_create_config_from_post(tmpdir):
 workspace = tmpdir.strpath
 temp_config_path = (workspace + '/config.yaml')
 make_default_config_if_needed(temp_config_path)
 temp_ip_detect_path = (workspace + '/ip-detect')
 f = open(temp_ip_detect_path, 'w')
 f.write('#/bin/bash foo')
 good_post_data = {'agent_list': ['10.0.0.2'], 'master_list': ['10.0.0.1'], 'cluster_name': 'Good Test', 'resolvers': ['4.4.4.4'], 'ip_detect_filename': temp_ip_detect_path}
 expected_good_messages = {}
 messages = backend.create_config_from_post(post_data=good_post_data, config_path=temp_config_path)
 assert (messages == expected_good_messages)

def test_good_create_config_from_post ( tmpdir ) : workspace = tmpdir . strpath temp_config_path = ( workspace + '/config.yaml' ) make_default_config_if_needed ( temp_config_path ) temp_ip_detect_path = ( workspace + '/ip-detect' ) f = open ( temp_ip_detect_path , 'w' ) f . write ( '#/bin/bash foo' ) good_post_data = { 'agent_list' : [ '10.0.0.2' ] , 'master_list' : [ '10.0.0.1' ] , 'cluster_name' : 'Good Test' , 'resolvers' : [ '4.4.4.4' ] , 'ip_detect_filename' : temp_ip_detect_path } expected_good_messages = { } messages = backend . create_config_from_post ( post_data = good_post_data , config_path = temp_config_path ) assert ( messages == expected_good_messages )
test that it creates the config .