Пример #1
0
def test_load_config_prepare():
    config = {
        'foo': {
            'image': 'foo',
            'env': {
                'bar': 'baz'
            },
            'cmd': 'some'
        },

        'bar': {
            'extend': 'foo',
            'cmd': 'other'
        }
    }

    yc = YamlConfig()

    processed = yc.prepare(config)

    assert processed['bar'] == {
        'image': 'foo',
        'env': {
            'bar': 'baz'
        },
        'cmd': 'other'
    }
Пример #2
0
def test_load_config_prepare():
    config = {
        'foo': {
            'image': 'foo',
            'env': {
                'bar': 'baz'
            },
            'cmd': 'some'
        },
        'bar': {
            'extend': 'foo',
            'cmd': 'other'
        }
    }

    yc = YamlConfig()

    processed = yc.prepare(config)

    assert processed['bar'] == {
        'image': 'foo',
        'env': {
            'bar': 'baz'
        },
        'cmd': 'other'
    }
Пример #3
0
def test_load_config_prepare_env():
    yc = YamlConfig(env='myenv')

    flexmock(yc).should_receive('filter_env').with_args({'foo': {'bar': 'baz'}}).once().and_return({'fas': {'bar': 'baz'}})
    processed = yc.prepare({'foo': {'bar': 'baz'}})

    assert processed == {'fas': {'bar': 'baz'}}
Пример #4
0
def test_load_config_prepare_env():
    yc = YamlConfig(env='myenv')

    flexmock(yc).should_receive('filter_env').with_args({
        'foo': {
            'bar': 'baz'
        }
    }).once().and_return({'fas': {
        'bar': 'baz'
    }})
    processed = yc.prepare({'foo': {'bar': 'baz'}})

    assert processed == {'fas': {'bar': 'baz'}}