(self)
| 232 | assert s.pretty() == unicode_box_pretty_result |
| 233 | |
| 234 | def test_decoding_errors(self): |
| 235 | # With strict error handling, it should reject bytes it can't decode |
| 236 | with self.assertRaises(UnicodeDecodeError): |
| 237 | self.make_screen_with_box_cp437('ascii', 'strict') |
| 238 | |
| 239 | # replace should turn them into unicode replacement characters, U+FFFD |
| 240 | s = self.make_screen_with_box_cp437('ascii', 'replace') |
| 241 | expected = u'\ufffd\ufffd\n\ufffd\ufffd' |
| 242 | if PY3: |
| 243 | assert str(s) == expected |
| 244 | else: |
| 245 | assert unicode(s) == expected |
| 246 | |
| 247 | def test_unicode_cp437 (self): |
| 248 | # Verify decoding from and re-encoding to CP437. |
nothing calls this directly
no test coverage detected