(self)
| 3661 | txt.buffer = buf |
| 3662 | |
| 3663 | def test_rawio(self): |
| 3664 | # Issue #12591: TextIOWrapper must work with raw I/O objects, so |
| 3665 | # that subprocess.Popen() can have the required unbuffered |
| 3666 | # semantics with universal_newlines=True. |
| 3667 | raw = self.MockRawIO([b'abc', b'def', b'ghi\njkl\nopq\n']) |
| 3668 | txt = self.TextIOWrapper(raw, encoding='ascii', newline='\n') |
| 3669 | # Reads |
| 3670 | self.assertEqual(txt.read(4), 'abcd') |
| 3671 | self.assertEqual(txt.readline(), 'efghi\n') |
| 3672 | self.assertEqual(list(txt), ['jkl\n', 'opq\n']) |
| 3673 | |
| 3674 | def test_rawio_write_through(self): |
| 3675 | # Issue #12591: with write_through=True, writes don't need a flush |
nothing calls this directly
no test coverage detected