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

Commit

Permalink
Make tests compatible with molecule 3.2 (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea committed Oct 28, 2020
1 parent 9674dfd commit bb77552
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
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

0 comments on commit bb77552

Please sign in to comment.