[checks] Relax check for genisoimage

The rules are similar to isohybrid, but there are no checks for
architecture.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2016-03-10 11:23:45 +01:00
parent d8f685000d
commit 0f3bfbbddf
2 changed files with 40 additions and 6 deletions

View file

@ -96,13 +96,38 @@ class CheckDependenciesTestCase(unittest.TestCase):
'runroot': True,
}
with mock.patch('platform.machine') as machine:
machine.return_value = 'armhfp'
with mock.patch('os.path.exists') as exists:
exists.side_effect = self.dont_find(['/usr/bin/isohybrid'])
result = checks.check(conf)
with mock.patch('os.path.exists') as exists:
exists.side_effect = self.dont_find(['/usr/bin/isohybrid'])
result = checks.check(conf)
self.assertTrue(result)
def test_genisoimg_not_needed_in_runroot(self):
conf = {
'runroot': True,
}
with mock.patch('os.path.exists') as exists:
exists.side_effect = self.dont_find(['/usr/bin/genisoimage'])
result = checks.check(conf)
self.assertTrue(result)
def test_genisoimg_needed_for_productimg(self):
conf = {
'runroot': True,
'productimg': True,
'bootable': True,
}
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/genisoimage'])
result = checks.check(conf)
self.assertIn('genisoimage', out.getvalue())
self.assertFalse(result)
if __name__ == "__main__":
unittest.main()