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

Commit

Permalink
Make driver compatible with molecule 3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea committed Oct 28, 2020
1 parent 426d193 commit 594d779
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
18 changes: 12 additions & 6 deletions lib/molecule_podman/test/test_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

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

Expand All @@ -23,20 +22,27 @@ 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",
"--role_name",
"test-init",
"--driver-name",
DRIVER,
]
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 @@ -66,7 +66,7 @@ setup_requires =

# These are required in actual runtime:
install_requires =
molecule >= 3.1.2
molecule >= 3.2.0a0
# selinux python module is needed as least by ansible-podman 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 594d779

Please sign in to comment.