diff --git a/molecule/default/tests/test_default.py b/molecule/default/tests/test_default.py index 3edca55..baf2d9d 100644 --- a/molecule/default/tests/test_default.py +++ b/molecule/default/tests/test_default.py @@ -29,3 +29,15 @@ def test_docker_interaction(host): """Validate interaction with docker.""" docker_ps = host.check_output("docker ps") assert docker_ps == "CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES" + +def test_docker_compose(host): + """Validate docker-compose installation""" + docker_compose_bin = host.file("/usr/local/bin/docker-compose") + assert not docker_compose_bin.exists + +def test_docker_python_package(host): + """Validate docker python package installation""" + pip_packages_list = host.pip.get_packages(pip_path='pip') + pip_outdated_list = host.pip.get_outdated_packages(pip_path='pip') + assert 'docker' not in pip_packages_list + assert 'docker' not in pip_outdated_list diff --git a/molecule/with_custom_config/tests/test_default.py b/molecule/with_custom_config/tests/test_default.py index f08b40a..1f71c56 100644 --- a/molecule/with_custom_config/tests/test_default.py +++ b/molecule/with_custom_config/tests/test_default.py @@ -43,11 +43,7 @@ def test_docker_compose(host): def test_docker_python_package(host): """Validate docker python package installation""" - docker_compose_pattern = r'^Docker Compose version v\d+\.\d+\.\d+$' - docker_compose_bin = host.file("/usr/local/bin/docker-compose") - docker_compose_version = host.check_output("docker-compose --version") - assert docker_compose_bin.exists - assert docker_compose_bin.user == "root" - assert docker_compose_bin.group == "root" - assert docker_compose_bin.mode == 0o755 - assert re.match(docker_compose_pattern,docker_compose_version) is not None \ No newline at end of file + pip_packages_list = host.pip.get_packages(pip_path='pip') + pip_outdated_list = host.pip.get_outdated_packages(pip_path='pip') + assert 'docker' in pip_packages_list + assert 'docker' not in pip_outdated_list \ No newline at end of file