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

Method test_buffered_readinto_mixin

Lib/test/test_io/test_general.py:697–708  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

695 self.open(os_helper.TESTFN, 'w', encoding="utf-8", newline='invalid')
696
697 def test_buffered_readinto_mixin(self):
698 # Test the implementation provided by BufferedIOBase
699 class Stream(self.BufferedIOBase):
700 def read(self, size):
701 return b"12345"
702 read1 = read
703 stream = Stream()
704 for method in ("readinto", "readinto1"):
705 with self.subTest(method):
706 buffer = byteslike(5)
707 self.assertEqual(getattr(stream, method)(buffer), 5)
708 self.assertEqual(bytes(buffer), b"12345")
709
710 def test_fspath_support(self):
711 def check_path_succeeds(path):

Callers

nothing calls this directly

Calls 4

StreamClass · 0.85
byteslikeFunction · 0.85
subTestMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected