(self)
| 2275 | "encoding=%r" % encoding) |
| 2276 | |
| 2277 | def test_seek(self): |
| 2278 | # all codecs should be able to encode these |
| 2279 | s = "%s\n%s\n" % (100*"abc123", 100*"def456") |
| 2280 | for encoding in all_unicode_encodings: |
| 2281 | if encoding == "idna": # FIXME: See SF bug #1163178 |
| 2282 | continue |
| 2283 | if encoding in broken_unicode_with_stateful: |
| 2284 | continue |
| 2285 | reader = codecs.getreader(encoding)(io.BytesIO(s.encode(encoding))) |
| 2286 | for t in range(5): |
| 2287 | # Test that calling seek resets the internal codec state and buffers |
| 2288 | reader.seek(0, 0) |
| 2289 | data = reader.read() |
| 2290 | self.assertEqual(s, data) |
| 2291 | |
| 2292 | def test_bad_decode_args(self): |
| 2293 | for encoding in all_unicode_encodings: |
nothing calls this directly
no test coverage detected