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' }
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'}}
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'}}