mock.call_args.kwargs was added after python 3.7, switched to the old way to allow 3.7 and below pass

This commit is contained in:
Yu Liao 2022-10-13 17:28:54 +00:00
parent 9be097199a
commit 3844f8e71c

View File

@ -147,7 +147,7 @@ class ExecProviderTest(unittest.TestCase):
instance.communicate.return_value = (self.output_ok, '')
ep = ExecProvider(self.input_ok, '/some/directory')
ep.run()
self.assertEqual(mock.call_args.kwargs['cwd'], '/some/directory')
self.assertEqual(mock.call_args[1]['cwd'], '/some/directory')
if __name__ == '__main__':