Skip to content
This repository has been archived by the owner on Jan 5, 2023. It is now read-only.

Make tests compatible with molecule 3.2 #19

Merged
merged 1 commit into from
Oct 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions molecule_docker/test/test_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
import subprocess

import pytest
import sh
from molecule import logger
from molecule import logger, util
from molecule.test.conftest import change_dir_to, run_command

import molecule_docker
Expand All @@ -25,20 +24,25 @@ def format_result(result: subprocess.CompletedProcess):
def test_command_init_scenario(temp_dir, DRIVER):
"""Verify that init scenario works."""
role_directory = os.path.join(temp_dir.strpath, "test-init")
options = {}
cmd = sh.molecule.bake("init", "role", "test-init", **options)
cmd = ["molecule", "init", "role", "test-init"]
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": DRIVER}
cmd = sh.molecule.bake("init", "scenario", "test-scenario", **options)
cmd = [
"molecule",
"init",
"scenario",
"test-scenario",
*util.dict2args(options),
]
run_command(cmd)

assert os.path.isdir(scenario_directory)

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


Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ setup_requires =

# These are required in actual runtime:
install_requires =
molecule >= 3.0.2
molecule >= 3.2.0a0
# selinux python module is needed as least by ansible-docker modules
# and allows us of isolated (default) virtualenvs. It does not avoid need
# to install the system selinux libraries but it will provide a clear
Expand Down