mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
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.
This commit is contained in:
parent
9505b03bb0
commit
84b6fb0eea
3 changed files with 18 additions and 2 deletions
|
@ -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):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue