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

Method test_read_bytes

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

Source from the content-addressed store, hash-verified

266
267
268 def test_read_bytes(self):
269 mock = mock_open(read_data=b'\xc6')
270 with patch('%s.open' % __name__, mock, create=True):
271 with open('abc', 'rb') as f:
272 result = f.read()
273 self.assertEqual(result, b'\xc6')
274
275
276 def test_readline_bytes(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