diff options
Diffstat (limited to 'test/units/modules/test_apt.py')
-rw-r--r-- | test/units/modules/test_apt.py | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/test/units/modules/test_apt.py b/test/units/modules/test_apt.py index 20e056ff..a5aa4a90 100644 --- a/test/units/modules/test_apt.py +++ b/test/units/modules/test_apt.py @@ -2,20 +2,13 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type import collections -import sys from units.compat.mock import Mock from units.compat import unittest -try: - from ansible.modules.apt import ( - expand_pkgspec_from_fnmatches, - ) -except Exception: - # Need some more module_utils work (porting urls.py) before we can test - # modules. So don't error out in this case. - if sys.version_info[0] >= 3: - pass +from ansible.modules.apt import ( + expand_pkgspec_from_fnmatches, +) class AptExpandPkgspecTestCase(unittest.TestCase): @@ -29,25 +22,25 @@ class AptExpandPkgspecTestCase(unittest.TestCase): ] def test_trivial(self): - foo = ["apt"] + pkg = ["apt"] self.assertEqual( - expand_pkgspec_from_fnmatches(None, foo, self.fake_cache), foo) + expand_pkgspec_from_fnmatches(None, pkg, self.fake_cache), pkg) def test_version_wildcard(self): - foo = ["apt=1.0*"] + pkg = ["apt=1.0*"] self.assertEqual( - expand_pkgspec_from_fnmatches(None, foo, self.fake_cache), foo) + expand_pkgspec_from_fnmatches(None, pkg, self.fake_cache), pkg) def test_pkgname_wildcard_version_wildcard(self): - foo = ["apt*=1.0*"] + pkg = ["apt*=1.0*"] m_mock = Mock() self.assertEqual( - expand_pkgspec_from_fnmatches(m_mock, foo, self.fake_cache), + expand_pkgspec_from_fnmatches(m_mock, pkg, self.fake_cache), ['apt', 'apt-utils']) def test_pkgname_expands(self): - foo = ["apt*"] + pkg = ["apt*"] m_mock = Mock() self.assertEqual( - expand_pkgspec_from_fnmatches(m_mock, foo, self.fake_cache), + expand_pkgspec_from_fnmatches(m_mock, pkg, self.fake_cache), ["apt", "apt-utils"]) |