From f27b120cfc641b76db994c29448207e21f873fbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Fri, 25 Sep 2020 12:38:13 +0200 Subject: [PATCH] tests: Fix mock usage for Python 2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `args` attribute doesn't work, let's instead access the arguments via index. Signed-off-by: Lubomír Sedlář --- tests/test_patch_iso.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_patch_iso.py b/tests/test_patch_iso.py index 93ccb5ff..55abf12b 100644 --- a/tests/test_patch_iso.py +++ b/tests/test_patch_iso.py @@ -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,