From 620b456012c09c6a68e1ef6d8e5ea7f072dd5bd0 Mon Sep 17 00:00:00 2001 From: Bertrand Lanson Date: Mon, 10 Jul 2023 23:56:31 +0200 Subject: [PATCH] removed python tests --- .../__pycache__/conftest.cpython-310.pyc | Bin 973 -> 0 bytes .../__pycache__/test_default.cpython-310.pyc | Bin 596 -> 0 bytes molecule/default/tests/conftest.py | 22 -------------- molecule/default/tests/test_default.py | 27 ------------------ molecule/with_custom_config/tests/conftest.py | 22 -------------- .../with_custom_config/tests/test_default.py | 27 ------------------ 6 files changed, 98 deletions(-) delete mode 100644 molecule/default/tests/__pycache__/conftest.cpython-310.pyc delete mode 100644 molecule/default/tests/__pycache__/test_default.cpython-310.pyc delete mode 100644 molecule/default/tests/conftest.py delete mode 100644 molecule/default/tests/test_default.py delete mode 100644 molecule/with_custom_config/tests/conftest.py delete mode 100644 molecule/with_custom_config/tests/test_default.py diff --git a/molecule/default/tests/__pycache__/conftest.cpython-310.pyc b/molecule/default/tests/__pycache__/conftest.cpython-310.pyc deleted file mode 100644 index fb635385615e0f05205a8d0511abf3bb56667dcb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 973 zcmZWoO>fgM7`D?iO}mXvV`4($kZaLsK)X%|GeDn z{D#|JR3@7Iw^LZ-@`$MFt=gq0W8y?1VtD44a!%1Wbou3M(#7-ph7DS_7l)KMmZiM z8W?|29U-;x9uI;+?J{&{8r(-$__9uGSJ-%@LA}FSb~w*=mS%mrbx`Dy0opo}xtK)b zKFgybr%Xke6f7+Si^kma%NU;bR1)!An?wjkTgvs(nXZ>@EB3bF(Dt9mBj|kJTF_hrUn0aaxlw}ea+5et42 z1ChSWH(O60#~QL84U_aNIb}MY>l>$1o^g=c7^Y&KvOG~-#v`V9kAvj~Jw89b9om`~ zAQW^@jZ~A1i+^M0c3+l2{ z@+)SEOvZ`ZT~xiU+Kbg<@cs|3mE<0B241jpji7AN13Z#=V6%aH+5{ zq^$!R)<)K}lYSD?xIED6j@S*{(!YD;tAT0WIMc8~8^JZx>WodM{@gT2#ix(VDG!Ge zF2;NWj@2lGXf-fl%vfRSJy_-hG~6n~eu7n%LgY~uc746tS}X}lsVoR@>~ubV*|Vf8 z8(zcf-^(G-DB{3ULd9F{i^(*+>wr$KGD?!hdx(e5k}P>kKTsPV!~jKEFH31eS$06D Z%Szb9rm%5b8;OTLi5Ki5Q%bgb{{b{EuiO9t diff --git a/molecule/default/tests/conftest.py b/molecule/default/tests/conftest.py deleted file mode 100644 index f7ddb3f..0000000 --- a/molecule/default/tests/conftest.py +++ /dev/null @@ -1,22 +0,0 @@ -"""PyTest Fixtures.""" -from __future__ import absolute_import - -import os - -import pytest - - -def pytest_runtest_setup(item): - """Run tests only when under molecule with testinfra installed.""" - try: - import testinfra - except ImportError: - pytest.skip("Test requires testinfra", allow_module_level=True) - if "MOLECULE_INVENTORY_FILE" in os.environ: - pytest.testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( - os.environ["MOLECULE_INVENTORY_FILE"] - ).get_hosts("all") - else: - pytest.skip( - "Test should run only from inside molecule.", allow_module_level=True - ) diff --git a/molecule/default/tests/test_default.py b/molecule/default/tests/test_default.py deleted file mode 100644 index cc481f0..0000000 --- a/molecule/default/tests/test_default.py +++ /dev/null @@ -1,27 +0,0 @@ -"""Role testing files using testinfra.""" - - -def test_hosts_file(host): - """Validate /etc/hosts file.""" - etc_hosts = host.file("/etc/hosts") - assert etc_hosts.exists - assert etc_hosts.user == "root" - assert etc_hosts.group == "root" - -def test_netplan_storage(host): - """Validate /etc/netplan directory.""" - etc_netplan = host.file("/etc/netplan") - assert etc_netplan.exists - assert etc_netplan.is_directory - assert etc_netplan.user == "root" - assert etc_netplan.group =="root" - assert etc_netplan.mode == 0o755 - -def test_netplan_config_file(host): - """Validate netplan config file.""" - etc_netplan_config = host.file("/etc/netplan/ansible-config.yaml") - assert etc_netplan_config.exists - assert etc_netplan_config.user == "root" - assert etc_netplan_config.group == "root" - assert etc_netplan_config.mode == 0o644 - assert etc_netplan_config.content_string != "" diff --git a/molecule/with_custom_config/tests/conftest.py b/molecule/with_custom_config/tests/conftest.py deleted file mode 100644 index f7ddb3f..0000000 --- a/molecule/with_custom_config/tests/conftest.py +++ /dev/null @@ -1,22 +0,0 @@ -"""PyTest Fixtures.""" -from __future__ import absolute_import - -import os - -import pytest - - -def pytest_runtest_setup(item): - """Run tests only when under molecule with testinfra installed.""" - try: - import testinfra - except ImportError: - pytest.skip("Test requires testinfra", allow_module_level=True) - if "MOLECULE_INVENTORY_FILE" in os.environ: - pytest.testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( - os.environ["MOLECULE_INVENTORY_FILE"] - ).get_hosts("all") - else: - pytest.skip( - "Test should run only from inside molecule.", allow_module_level=True - ) diff --git a/molecule/with_custom_config/tests/test_default.py b/molecule/with_custom_config/tests/test_default.py deleted file mode 100644 index 4d46981..0000000 --- a/molecule/with_custom_config/tests/test_default.py +++ /dev/null @@ -1,27 +0,0 @@ -"""Role testing files using testinfra.""" - - -def test_hosts_file(host): - """Validate /etc/hosts file.""" - etc_hosts = host.file("/etc/hosts") - assert etc_hosts.exists - assert etc_hosts.user == "root" - assert etc_hosts.group == "root" - -def test_netplan_storage(host): - """Validate /etc/netplan directory.""" - etc_netplan = host.file("/etc/netplan") - assert etc_netplan.exists - assert etc_netplan.is_directory - assert etc_netplan.user == "root" - assert etc_netplan.group =="root" - assert etc_netplan.mode == 0o755 - -def test_netplan_config_file(host): - """Validate netplan config file.""" - etc_netplan_config = host.file("/tmp/ansible-config.yaml") - assert etc_netplan_config.exists - assert etc_netplan_config.user == "root" - assert etc_netplan_config.group == "root" - assert etc_netplan_config.mode == 0o644 - assert etc_netplan_config.content_string != ""