예제 #1
0
def test_simple_cloudformation_stack_during_update_custom():
    def gsp():
        return 'have indiv. policy'
    cf = _create_simple_cf()
    cf.get_stack_policy_during_update = gsp
    stack_policy = _get_stack_policy_during_update(cf, False)
    assert_equal(stack_policy, 'have indiv. policy')
예제 #2
0
def test_simple_cloudformation_stack_during_update_default():
    cf = _create_simple_cf()
    stack_policy = _get_stack_policy_during_update(cf, False)
    assert_regexp_matches(stack_policy, '{"Statement":')
    assert_equal('Deny', json.loads(stack_policy)['Statement'][1]['Effect'])
    assert_list_equal(["Update:Replace", "Update:Delete"],
                      json.loads(stack_policy)['Statement'][1]['Action'])
예제 #3
0
def test_simple_cloudformation_stack_during_update_override_custom():
    # test make sure override has no impact on custom policy
    def gsp():
        return 'have indiv. policy'
    cf = _create_simple_cf()
    cf.get_stack_policy_during_update = gsp
    stack_policy = _get_stack_policy_during_update(cf, True)
    assert_equal(stack_policy, 'have indiv. policy')
예제 #4
0
def test_simple_cloudformation_stack_during_update_override_default():
    cf = _create_simple_cf()
    stack_policy = _get_stack_policy_during_update(cf, True)
    assert_regexp_matches(stack_policy, '{"Statement":')