Fix unit test when run on CentOS 7

Fix unit test test_cmd_get_version_of_installed_package_mapped when run
on a CentOS 7 system.

   testtools.matchers._impl.MismatchError: !=:
   reference = 'rpm -q --queryformat %{VERSION} haproxy'
   actual    = 'rpm -q --queryformat %{VERSION} haproxy18'

Change-Id: I81f76afc7e3fa6f190c30f33198197cb627cce26
This commit is contained in:
Carlos Goncalves 2019-12-09 10:02:57 +01:00
parent 3740b67854
commit f5eeb513b5
1 changed files with 2 additions and 1 deletions

View File

@ -44,7 +44,8 @@ class TestOSUtils(base.TestCase):
self.rh_os_util = osutils.BaseOS.get_os_util()
with mock.patch('distro.id', return_value='centos'):
self.centos_os_util = osutils.BaseOS.get_os_util()
with mock.patch('distro.version', return_value='8'):
self.centos_os_util = osutils.BaseOS.get_os_util()
with mock.patch('distro.id', return_value='centos'):
with mock.patch('distro.version', return_value='7'):