Skip to content
Snippets Groups Projects
Commit 44d02150 authored by nimrod's avatar nimrod
Browse files

Merge branch 'bug/testinfra_host_fixture'

parents f66cd0fc c4cffa8e
No related branches found
No related tags found
No related merge requests found
...@@ -3,10 +3,10 @@ from testinfra.utils.ansible_runner import AnsibleRunner ...@@ -3,10 +3,10 @@ from testinfra.utils.ansible_runner import AnsibleRunner
testinfra_hosts = AnsibleRunner('.molecule/ansible_inventory').get_hosts('all') testinfra_hosts = AnsibleRunner('.molecule/ansible_inventory').get_hosts('all')
def test_example(Command): def test_example(host):
assert Command('uname').rc == 0 assert host.run('uname').rc == 0
def test_root(Command, Sudo): def test_root(host):
with Sudo(): with host.sudo():
assert Command('whoami').stdout.strip() == 'root' assert host.run('whoami').stdout.strip() == 'root'
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