tests: Fix mock usage for Python 2
The `args` attribute doesn't work, let's instead access the arguments via index. Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
parent
9df3f42a44
commit
f27b120cfc
@ -153,7 +153,7 @@ class TestPatchingIso(unittest.TestCase):
|
|||||||
self.assertEqual(iso.mount.call_args_list, [mock.call("source.iso")])
|
self.assertEqual(iso.mount.call_args_list, [mock.call("source.iso")])
|
||||||
self.assertEqual(copy_all.mock_calls, [mock.call("mounted-iso-dir", ANYTHING)])
|
self.assertEqual(copy_all.mock_calls, [mock.call("mounted-iso-dir", ANYTHING)])
|
||||||
self.assertTrue(
|
self.assertTrue(
|
||||||
copy_all.call_args.args[1].startswith("/tmp/custom-workdir/patch-iso-")
|
copy_all.call_args[0][1].startswith("/tmp/custom-workdir/patch-iso-")
|
||||||
)
|
)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
sh.call_args_list,
|
sh.call_args_list,
|
||||||
|
Loading…
Reference in New Issue
Block a user