MCPcopy Index your code
hub / github.com/python/cpython / test_read_data

Method test_read_data

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

Source from the content-addressed store, hash-verified

189
190
191 def test_read_data(self):
192 mock = mock_open(read_data='foo')
193 with patch('%s.open' % __name__, mock, create=True):
194 h = open('bar')
195 result = h.read()
196
197 self.assertEqual(result, 'foo')
198
199
200 def test_readline_data(self):

Callers

nothing calls this directly

Calls 5

mock_openFunction · 0.90
patchFunction · 0.90
openFunction · 0.50
readMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected