summaryrefslogtreecommitdiffstats
path: root/Lib/unittest/test
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-01-06 17:15:51 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2017-01-06 17:15:51 (GMT)
commit84b6fb0eea29b3b28a1a11124526b01ec0c9d17a (patch)
tree36adf93741ffd1325d0b9a3c9bd7631efbf082ab /Lib/unittest/test
parent9505b03bb0d3c5828115fec9306cb976c43f04d9 (diff)
downloadcpython-84b6fb0eea29b3b28a1a11124526b01ec0c9d17a.zip
cpython-84b6fb0eea29b3b28a1a11124526b01ec0c9d17a.tar.gz
cpython-84b6fb0eea29b3b28a1a11124526b01ec0c9d17a.tar.bz2
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.
Diffstat (limited to 'Lib/unittest/test')
-rw-r--r--Lib/unittest/test/testmock/testhelpers.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/unittest/test/testmock/testhelpers.py b/Lib/unittest/test/testmock/testhelpers.py
index 3477634..d5f9e7c 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):