예제 #1
0
def test_execution_step_instantiation(ipaconfig, flattened_config,
                                      substituted_commands, default_namespace):
    step_name, commands = substituted_commands
    command_templates = ipaconfig['steps'][step_name]

    step = command.ExecutionStep(command_templates, flattened_config,
                                 **default_namespace)

    assert step.commands == commands
예제 #2
0
def run_step(docker_container, step_name, **kwargs):

    step_cfg = docker_container.config['steps']
    flat_cfg = docker_container.config.flatten()

    try:
        step = command.ExecutionStep(step_cfg[step_name], flat_cfg, **kwargs)
        step(docker_container)
    except KeyError as e:
        raise RuntimeError('Invalid template variable: {}'.format(e))
예제 #3
0
def test_invalid_template_string(flattened_config):
    with pytest.raises(KeyError):
        command.ExecutionStep(['make ${invalid_var}'], flattened_config)