Пример #1
0
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)
Пример #2
0
def output_test():
    ui = UserInput(['--fact', 'server_type', 'webapp', '--debug', '-o', 'hostname'])
    data = ui.get_args_as_dict()
    assert_equal(data, MOCK_DATA_OUTPUT)
Пример #3
0
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'} )
Пример #4
0
def single_fact_test2():
    ui = UserInput(['--fact', 'server_type', 'webapp', '--debug'])
    data = ui.get_facts_as_dict()