[checks] Fix tests to never use real real arch

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2016-03-10 18:54:14 +01:00
parent e77821987c
commit 07f5da5d4f
2 changed files with 11 additions and 7 deletions

View File

@ -36,7 +36,7 @@ def is_isohybrid_needed(conf):
runroot = conf.get('runroot', False)
if runroot and not _will_productimg_run(conf):
return False
if platform.machine() not in ('x86_64', 'i386'):
if platform.machine() not in ('x86_64', 'i686', 'i386'):
msg = ('Not checking for /usr/bin/isohybrid due to current architecture. '
'Expect failures in productimg phase.')
print msg

View File

@ -31,6 +31,8 @@ class CheckDependenciesTestCase(unittest.TestCase):
def test_all_deps_ok(self):
with mock.patch('sys.stdout', new_callable=StringIO.StringIO) as out:
with mock.patch('platform.machine') as machine:
machine.return_value = 'x86_64'
with mock.patch('os.path.exists') as exists:
exists.side_effect = self.dont_find([])
result = checks.check({})
@ -44,6 +46,8 @@ class CheckDependenciesTestCase(unittest.TestCase):
}
with mock.patch('sys.stdout', new_callable=StringIO.StringIO) as out:
with mock.patch('platform.machine') as machine:
machine.return_value = 'x86_64'
with mock.patch('os.path.exists') as exists:
exists.side_effect = self.dont_find(['/usr/bin/jigdo-lite'])
result = checks.check(conf)