From 84b6fb0eea29b3b28a1a11124526b01ec0c9d17a Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 6 Jan 2017 18:15:51 +0100 Subject: Fix unittest.mock._Call: don't ignore name Issue #28961: Fix unittest.mock._Call helper: don't ignore the name parameter anymore. Patch written by Jiajun Huang. --- Lib/unittest/test/testmock/testhelpers.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Lib/unittest/test/testmock/testhelpers.py') diff --git a/Lib/unittest/test/testmock/testhelpers.py b/Lib/unittest/test/testmock/testhelpers.py index 34776347daa..d5f9e7c1d69 100644 --- a/Lib/unittest/test/testmock/testhelpers.py +++ b/Lib/unittest/test/testmock/testhelpers.py @@ -306,6 +306,20 @@ class CallTest(unittest.TestCase): other_args = _Call(((1, 2), {'a': 3})) self.assertEqual(args, other_args) + def test_call_with_name(self): + self.assertEqual( + 'foo', + _Call((), 'foo')[0], + ) + self.assertEqual( + '', + _Call((('bar', 'barz'), ), )[0] + ) + self.assertEqual( + '', + _Call((('bar', 'barz'), {'hello': 'world'}), )[0] + ) + class SpecSignatureTest(unittest.TestCase): -- cgit v1.2.3