(self)
| 228 | self.assertEqual(e.encode(inv, True), b'') |
| 229 | |
| 230 | def test_streamreader(self): |
| 231 | UTF8Writer = codecs.getwriter('utf-8') |
| 232 | for name in ["read", "readline", "readlines"]: |
| 233 | for sizehint in [None, -1] + list(range(1, 33)) + \ |
| 234 | [64, 128, 256, 512, 1024]: |
| 235 | istream = self.reader(BytesIO(self.tstring[0])) |
| 236 | ostream = UTF8Writer(BytesIO()) |
| 237 | func = getattr(istream, name) |
| 238 | while 1: |
| 239 | data = func(sizehint) |
| 240 | if not data: |
| 241 | break |
| 242 | if name == "readlines": |
| 243 | ostream.writelines(data) |
| 244 | else: |
| 245 | ostream.write(data) |
| 246 | |
| 247 | self.assertEqual(ostream.getvalue(), self.tstring[1]) |
| 248 | |
| 249 | def test_streamwriter(self): |
| 250 | readfuncs = ('read', 'readline', 'readlines') |
nothing calls this directly
no test coverage detected