xoxys.python3/molecule/rocky8/tests/test_default.py

22 lines
483 B
Python
Raw Normal View History

2021-10-03 16:32:54 +02:00
import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("all")
def test_python3_is_installed(host):
2021-10-04 20:47:49 +02:00
python3 = host.package("python39")
pip3 = host.package("python39-pip")
2021-10-03 16:32:54 +02:00
assert python3.is_installed
assert pip3.is_installed
2021-10-04 20:47:49 +02:00
def test_python3_bin(host):
2021-10-04 21:06:29 +02:00
version = host.run("/usr/bin/python3.9 --version").stdout
2021-10-04 20:47:49 +02:00
assert "Python 3.9" in version