Skip to content

Commit

Permalink
fix linting (I've no idea what I'm doing here)
Browse files Browse the repository at this point in the history
  • Loading branch information
stdevel committed Mar 28, 2024
1 parent fcb5a8d commit 94b9f8f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
8 changes: 4 additions & 4 deletions roles/client/molecule/default/tests/test_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import testinfra.utils.ansible_runner

TESTINFRA_HOSTS = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']
).get_hosts('all')
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("all")


def test_packages(host):
Expand All @@ -35,6 +35,6 @@ def test_initialization(host):
with host.sudo():
_config = host.file("/etc/landscape/client.conf")
assert _config.exists
assert _config.contains('https://landscape.canonical.com') is False
for _key in ['url', 'ping_url', 'data_path']:
assert _config.contains("https://landscape.canonical.com") is False
for _key in ["url", "ping_url", "data_path"]:
assert _config.contains(f"{_key} =")
4 changes: 2 additions & 2 deletions roles/server/molecule/default/tests/test_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import testinfra.utils.ansible_runner

TESTINFRA_HOSTS = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']
).get_hosts('all')
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("all")


def test_packages(host):
Expand Down
13 changes: 4 additions & 9 deletions roles/storage/molecule/default/tests/test_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,17 @@
import testinfra.utils.ansible_runner

TESTINFRA_HOSTS = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']
).get_hosts('all')
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("all")


def test_lvm(host):
"""
test if storage was set-up correctly
"""
# get variables from file
ansible_vars = host.ansible(
"include_vars",
"file=vars/main.yml"
)
ansible_vars = host.ansible("include_vars", "file=vars/main.yml")
# check file systems
for filesys in ansible_vars["ansible_facts"]["storage_filesystems"]:
assert host.mount_point(filesys["mountpoint"]).exists
assert host.mount_point(
filesys["mountpoint"]
).filesystem == filesys["type"]
assert host.mount_point(filesys["mountpoint"]).filesystem == filesys["type"]

0 comments on commit 94b9f8f

Please sign in to comment.