Exemplo n.º 1
0
def test_process_with_local_config():
    c = YamlConfig(source='{"nginx": {"image": "bar"}, "---": {"commands": {"bar": ["foo"]}}}')

    flexmock(c)

    c.should_receive('process_local_config').once().with_args({"commands": {"bar": ["foo"]}})
    c.load(process=False)
Exemplo n.º 2
0
def test_process_with_local_config():
    c = YamlConfig(
        source=
        '{"nginx": {"image": "bar"}, "---": {"commands": {"bar": ["foo"]}}}')

    flexmock(c)

    c.should_receive('process_local_config').once().with_args(
        {"commands": {
            "bar": ["foo"]
        }})
    c.load(process=False)
Exemplo n.º 3
0
def test_process_with_app_name():
    c = YamlConfig()

    flexmock(c)

    c.should_receive('process_image_build').once()
    c.should_receive('process_volumes_build').once()
    c.should_receive('process_command_build').once()

    c.process({'nginx': {'foo': 'bar'}}, path='foo', app_name='myapp')

    assert isinstance(c.services['nginx.myapp'], Service)
    assert c.services['nginx.myapp'].name == 'nginx.myapp'
Exemplo n.º 4
0
def test_process_with_app_name():
    c = YamlConfig()

    flexmock(c)

    c.should_receive('process_image_build').once()
    c.should_receive('process_volumes_build').once()
    c.should_receive('process_command_build').once()

    c.process({
                  'nginx': {'foo': 'bar'}
              }, path='foo', app_name='myapp')

    assert isinstance(c.services['nginx.myapp'], Service)
    assert c.services['nginx.myapp'].name == 'nginx.myapp'