MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_readinto

Method test_readinto

Lib/test/test_io.py:2269–2276  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2267 self.assertEqual(pair.read1(), b"def")
2268
2269 def test_readinto(self):
2270 for method in ("readinto", "readinto1"):
2271 with self.subTest(method):
2272 pair = self.tp(self.BytesIO(b"abcdef"), self.MockRawIO())
2273
2274 data = byteslike(b'\0' * 5)
2275 self.assertEqual(getattr(pair, method)(data), 5)
2276 self.assertEqual(bytes(data), b"abcde")
2277
2278 def test_write(self):
2279 w = self.MockRawIO()

Callers

nothing calls this directly

Calls 4

byteslikeFunction · 0.85
getattrFunction · 0.85
subTestMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected