Skip to content
Snippets Groups Projects
Commit 09e60000 authored by Benjamin Bertrand's avatar Benjamin Bertrand
Browse files

Switch to the testinfra host fixture

parent d6bb30af
No related branches found
No related tags found
No related merge requests found
...@@ -4,8 +4,8 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( ...@@ -4,8 +4,8 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
'.molecule/ansible_inventory').get_hosts('all') '.molecule/ansible_inventory').get_hosts('all')
def test_conda_user(User): def test_conda_user(host):
user = User('conda') user = host.user('conda')
assert user.exists assert user.exists
assert user.group == 'users' assert user.group == 'users'
assert user.home == '/home/conda' assert user.home == '/home/conda'
...@@ -13,12 +13,12 @@ def test_conda_user(User): ...@@ -13,12 +13,12 @@ def test_conda_user(User):
assert user.expiration_date is None assert user.expiration_date is None
def test_conda_version(Command): def test_conda_version(host):
cmd = Command('/opt/conda/bin/conda --version 2>&1') cmd = host.run('/opt/conda/bin/conda --version 2>&1')
assert cmd.rc == 0 assert cmd.rc == 0
assert cmd.stdout.strip() == 'conda 4.3.14' assert cmd.stdout.strip() == 'conda 4.3.14'
def test_conda_path(Command): def test_conda_path(host):
cmd = Command('su -l -c "echo \$PATH" conda') cmd = host.run('su -l -c "echo \$PATH" conda')
assert cmd.stdout.startswith('/opt/conda/bin:') assert cmd.stdout.startswith('/opt/conda/bin:')
...@@ -5,8 +5,8 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( ...@@ -5,8 +5,8 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
'.molecule/ansible_inventory').get_hosts('set_uid') '.molecule/ansible_inventory').get_hosts('set_uid')
def test_conda_uid(User): def test_conda_uid(host):
user = User('conda') user = host.user('conda')
assert user.uid == 48 assert user.uid == 48
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment