From 0a042990960b49c50467ffd113a6c76cda7fad76 Mon Sep 17 00:00:00 2001 From: Lubomír Sedlář Date: Mar 11 2016 16:51:38 +0000 Subject: [checks] Fix tests to never use real real arch Signed-off-by: Lubomír Sedlář --- diff --git a/pungi/checks.py b/pungi/checks.py index 5b29efa..6895b2a 100644 --- a/pungi/checks.py +++ b/pungi/checks.py @@ -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 diff --git a/tests/test_checks.py b/tests/test_checks.py index 3b948be..a0a49e0 100755 --- a/tests/test_checks.py +++ b/tests/test_checks.py @@ -31,9 +31,11 @@ class CheckDependenciesTestCase(unittest.TestCase): def test_all_deps_ok(self): with mock.patch('sys.stdout', new_callable=StringIO.StringIO) as out: - with mock.patch('os.path.exists') as exists: - exists.side_effect = self.dont_find([]) - result = checks.check({}) + 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({}) self.assertEqual('', out.getvalue()) self.assertTrue(result) @@ -44,9 +46,11 @@ class CheckDependenciesTestCase(unittest.TestCase): } with mock.patch('sys.stdout', new_callable=StringIO.StringIO) as out: - with mock.patch('os.path.exists') as exists: - exists.side_effect = self.dont_find(['/usr/bin/jigdo-lite']) - result = checks.check(conf) + 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) self.assertEqual('', out.getvalue()) self.assertTrue(result)