diff options
author | Jan Pokorný <jpokorny@redhat.com> | 2015-02-23 14:06:21 +0100 |
---|---|---|
committer | Jan Pokorný <jpokorny@redhat.com> | 2015-02-26 22:40:49 +0100 |
commit | 91eec8141c31ca166c8efc928e79dd9bdb01dcbe (patch) | |
tree | 5276f1090aa66759ec60c7273fb732748d609f7c /tests | |
parent | a0c51ed6e2093c1830242b3c1577e3ee60e34949 (diff) | |
download | clufter-91eec8141c31ca166c8efc928e79dd9bdb01dcbe.tar.gz clufter-91eec8141c31ca166c8efc928e79dd9bdb01dcbe.tar.xz clufter-91eec8141c31ca166c8efc928e79dd9bdb01dcbe.zip |
facts: cmd_pkg_install: return empty string when no pkgs
Also revamp respective unit tests.
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/facts.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/facts.py b/tests/facts.py index 6926106..e059818 100644 --- a/tests/facts.py +++ b/tests/facts.py @@ -63,7 +63,7 @@ class TestPackage(TestCase): self.assertEqual(package('virsh', *sys_id), 'libvirt-client') -class TestCommand(TestCase): +class TestPkgInstall(TestCase): def test_pkg_install_rhel60(self): sys_id = 'linux', ('redhat', ' 6.0') self.assertEqual(cmd_pkg_install(('mc', 'vim'), *sys_id), @@ -76,6 +76,12 @@ class TestCommand(TestCase): sys_id = 'linux', ('fedora', ' 19') self.assertEqual(cmd_pkg_install(('mc', 'vim'), *sys_id), 'yum install -y mc vim') + def test_pkg_install_unknown(self): + sys_id = 'linux', ('frobnical', ' 21') + self.assertEqual(cmd_pkg_install(('gnomovision', ), *sys_id), '') + def test_pkg_install_empty(self): + sys_id = 'linux', ('fedora', ' 21') + self.assertEqual(cmd_pkg_install((), *sys_id), '') from os.path import join, dirname as d; execfile(join(d(d(__file__)), '_gone')) |