Пример #1
0
def test_set_value_list():
    arm = ArmFile('tests/test_template.json')
    key = 'resources'
    my_list = ['a', 'b', 'c']
    arm.set_value(key, my_list)
    changes = arm.get_change_log()
    old = 'old_value'
    new = 'new_value'
    assert changes[key][old] != changes[key][new]
    assert changes[key][new] == my_list
    assert arm.get_value(key) == my_list
Пример #2
0
def test_set_value_list_index():
    arm = ArmFile('tests/test_template.json')
    key = 'resources'
    my_dict = {"a": 1, "b": "string", "c": True}
    arm.set_value(key, my_dict, 0)
    changes = arm.get_change_log()
    old = 'old_value'
    new = 'new_value'
    assert changes[key][old] != changes[key][new]
    assert changes[key][new][0] == my_dict
    assert arm.get_value(key, 0) == my_dict
Пример #3
0
def test_change_log():
    arm = ArmFile('tests/test_template.json')
    key = 'parameters.storageAccountType.defaultValue'
    key2 = 'parameters.location.type'
    old = 'old_value'
    new = 'new_value'
    arm.set_value(key, 'changed')
    arm.set_value(key2, 'updated')
    changes = arm.get_change_log()
    assert changes[key][old] == 'Standard_LRS'
    assert changes[key][new] == 'changed'
    assert changes[key2][old] == 'string'
    assert changes[key2][new] == 'updated'