MCPcopy Create free account
hub / github.com/python/cpython / test_attribute_call

Method test_attribute_call

Lib/test/test_unittest/testmock/testhelpers.py:268–277  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

266 [call(1, 2, 3), call(a=3, b=6)])
267
268 def test_attribute_call(self):
269 self.assertEqual(call.foo(1), ('foo', (1,), {}))
270 self.assertEqual(call.bar.baz(fish='eggs'),
271 ('bar.baz', (), {'fish': 'eggs'}))
272
273 mock = Mock()
274 mock.foo(1, 2 ,3)
275 mock.bar.baz(a=3, b=6)
276 self.assertEqual(mock.method_calls,
277 [call.foo(1, 2, 3), call.bar.baz(a=3, b=6)])
278
279
280 def test_extended_call(self):

Callers

nothing calls this directly

Calls 4

MockClass · 0.90
assertEqualMethod · 0.45
fooMethod · 0.45
bazMethod · 0.45

Tested by

no test coverage detected