Beispiel #1
0
def test_vagrant_root(temp_dir, scenario):
    options = {"scenario_name": scenario}

    scenario_directory = os.path.join(os.path.dirname(util.abs_path(__file__)),
                                      os.path.pardir, "scenarios")

    with change_dir_to(scenario_directory):
        cmd = sh.molecule.bake("test", **options)
        run_command(cmd)
def test_command_init_scenario(temp_dir):
    role_directory = os.path.join(temp_dir.strpath, "test-init")
    options = {}
    cmd = sh.molecule.bake("init", "role", "test-init", **options)
    run_command(cmd)

    with change_dir_to(role_directory):
        molecule_directory = pytest.helpers.molecule_directory()
        scenario_directory = os.path.join(molecule_directory, "test-scenario")
        options = {"role_name": "test-init", "driver-name": "vagrant"}
        cmd = sh.molecule.bake("init", "scenario", "test-scenario", **options)
        run_command(cmd)

        assert os.path.isdir(scenario_directory)

        cmd = sh.molecule.bake("--debug", "test", "-s", "test-scenario")
        run_command(cmd)