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:
Lubomír Sedlář 2020-09-25 12:38:13 +02:00
parent 9df3f42a44
commit f27b120cfc

View File

@ -153,7 +153,7 @@ class TestPatchingIso(unittest.TestCase):
self.assertEqual(iso.mount.call_args_list, [mock.call("source.iso")])
self.assertEqual(copy_all.mock_calls, [mock.call("mounted-iso-dir", ANYTHING)])
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(
sh.call_args_list,