Пример #1
0
def test_parse_not_condition():
    parse_condition(
        condition={
            "Fn::Not": [{
                "Fn::Equals": [{
                    "Ref": "EnvType"
                }, "prod"]
            }]
        },
        resources_map={
            "EnvType": "prod"
        },
        condition_map={},
    ).should.equal(False)

    parse_condition(
        condition={
            "Fn::Not": [{
                "Fn::Equals": [{
                    "Ref": "EnvType"
                }, "prod"]
            }]
        },
        resources_map={
            "EnvType": "staging"
        },
        condition_map={},
    ).should.equal(True)
Пример #2
0
def test_parse_equals_condition():
    parse_condition(
        condition={"Fn::Equals": [{"Ref": "EnvType"}, "prod"]}, resources_map={"EnvType": "prod"}, condition_map={}
    ).should.equal(True)

    parse_condition(
        condition={"Fn::Equals": [{"Ref": "EnvType"}, "prod"]}, resources_map={"EnvType": "staging"}, condition_map={}
    ).should.equal(False)
Пример #3
0
def test_reference_other_conditions():
    parse_condition(
        condition={
            "Fn::Not": [{
                "Condition": "OtherCondition"
            }]
        },
        resources_map={},
        condition_map={
            "OtherCondition": True
        },
    ).should.equal(False)
Пример #4
0
def test_reference_other_conditions():
    parse_condition(
        condition={"Fn::Not": [{"Condition": "OtherCondition"}]},
        resources_map={},
        condition_map={"OtherCondition": True},
    ).should.equal(False)