From c79096d6fa1460c882c68ea0c30a4caacd678adf Mon Sep 17 00:00:00 2001 From: Adar Nimrod Date: Fri, 9 Dec 2016 19:06:45 +0200 Subject: [PATCH] - Use SystemInfo to determine to OS type (instead of using the facts from the Ansbile module and the Testinfra backend module, which is just ugly code). --- tests/test_deploy_key.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/tests/test_deploy_key.py b/tests/test_deploy_key.py index b6f99b6..6ef7c71 100644 --- a/tests/test_deploy_key.py +++ b/tests/test_deploy_key.py @@ -8,15 +8,9 @@ def test_deploy_key(Command, Sudo): assert Command('git -C /tmp/ansible-role-deploy-key pull').rc == 0 -def test_deply_key_alias(File, Ansible, User, TestinfraBackend): +def test_deply_key_alias(File, User, SystemInfo): assert User('nobody').exists - connection = TestinfraBackend.get_connection_type() - if connection == 'docker': - ansible_os_family = 'Debian' - elif connection == 'ansible': - ansible_os_family = Ansible('setup')['ansible_facts'][ - 'ansible_os_family'] - if ansible_os_family == 'Debian': + if SystemInfo.type == 'linux': assert File('/etc/aliases').contains('nobody: root') - elif ansible_os_family == 'OpenBSD': + elif SystemInfo.type == 'openbsd': assert File('/etc/mail/aliases').contains('nobody: root') -- GitLab