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

Method test_explicit_mock

Lib/test/test_unittest/testmock/testwith.py:180–188  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

178 self.assertEqual(mock.mock_calls, expected_calls)
179
180 def test_explicit_mock(self):
181 mock = MagicMock()
182 mock_open(mock)
183
184 with patch('%s.open' % __name__, mock, create=True) as patched:
185 self.assertIs(patched, mock)
186 open('foo')
187
188 mock.assert_called_once_with('foo')
189
190
191 def test_read_data(self):

Callers

nothing calls this directly

Calls 6

MagicMockClass · 0.90
mock_openFunction · 0.90
patchFunction · 0.90
openFunction · 0.50
assertIsMethod · 0.45

Tested by

no test coverage detected