(self)
| 1001 | txt.buffer = buf |
| 1002 | |
| 1003 | def test_rawio(self): |
| 1004 | # Issue #12591: TextIOWrapper must work with raw I/O objects, so |
| 1005 | # that subprocess.Popen() can have the required unbuffered |
| 1006 | # semantics with universal_newlines=True. |
| 1007 | raw = self.MockRawIO([b'abc', b'def', b'ghi\njkl\nopq\n']) |
| 1008 | txt = self.TextIOWrapper(raw, encoding='ascii', newline='\n') |
| 1009 | # Reads |
| 1010 | self.assertEqual(txt.read(4), 'abcd') |
| 1011 | self.assertEqual(txt.readline(), 'efghi\n') |
| 1012 | self.assertEqual(list(txt), ['jkl\n', 'opq\n']) |
| 1013 | |
| 1014 | def test_rawio_write_through(self): |
| 1015 | # Issue #12591: with write_through=True, writes don't need a flush |
nothing calls this directly
no test coverage detected