def single_fact_test1(): ui = UserInput(['--fact', 'server_type', 'webapp', '--debug']) data = ui.get_args_as_dict() data_class_var = ui.data facts = ui.get_facts_as_dict() facts_class_var = ui.get_facts_as_dict() assert_equal(data, MOCK_DATA1) assert_equal(data, data_class_var) assert_equal(facts, {'server_type': 'webapp'} ) assert_equal(facts, facts_class_var)
def output_test(): ui = UserInput(['--fact', 'server_type', 'webapp', '--debug', '-o', 'hostname']) data = ui.get_args_as_dict() assert_equal(data, MOCK_DATA_OUTPUT)
def two_facts_test(): ui = UserInput(['--fact', 'server_type', 'webapp', '--debug', '--fact', 'ec2_instance_type', 'm1.large']) data = ui.get_args_as_dict() facts = ui.get_facts_as_dict() assert_equal(data, MOCK_DATA2) assert_equal(facts, {'server_type': 'webapp', 'ec2_instance_type': 'm1.large'} )
def single_fact_test2(): ui = UserInput(['--fact', 'server_type', 'webapp', '--debug']) data = ui.get_facts_as_dict()