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

Commit bb77552

Browse files
authored
Make tests compatible with molecule 3.2 (#19)
Related: ansible/molecule#2917
1 parent 9674dfd commit bb77552

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

molecule_docker/test/test_func.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
import subprocess
44

55
import pytest
6-
import sh
7-
from molecule import logger
6+
from molecule import logger, util
87
from molecule.test.conftest import change_dir_to, run_command
98

109
import molecule_docker
@@ -25,20 +24,25 @@ def format_result(result: subprocess.CompletedProcess):
2524
def test_command_init_scenario(temp_dir, DRIVER):
2625
"""Verify that init scenario works."""
2726
role_directory = os.path.join(temp_dir.strpath, "test-init")
28-
options = {}
29-
cmd = sh.molecule.bake("init", "role", "test-init", **options)
27+
cmd = ["molecule", "init", "role", "test-init"]
3028
run_command(cmd)
3129

3230
with change_dir_to(role_directory):
3331
molecule_directory = pytest.helpers.molecule_directory()
3432
scenario_directory = os.path.join(molecule_directory, "test-scenario")
3533
options = {"role_name": "test-init", "driver-name": DRIVER}
36-
cmd = sh.molecule.bake("init", "scenario", "test-scenario", **options)
34+
cmd = [
35+
"molecule",
36+
"init",
37+
"scenario",
38+
"test-scenario",
39+
*util.dict2args(options),
40+
]
3741
run_command(cmd)
3842

3943
assert os.path.isdir(scenario_directory)
4044

41-
cmd = sh.molecule.bake("--debug", "test", "-s", "test-scenario")
45+
cmd = ["molecule", "--debug", "test", "-s", "test-scenario"]
4246
run_command(cmd)
4347

4448

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ setup_requires =
6363

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

0 commit comments

Comments
 (0)