~ubuntu-branches/ubuntu/maverick/python3.1/maverick

« back to all changes in this revision

Viewing changes to Lib/test/test_codecencodings_tw.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2009-03-23 00:01:27 UTC
  • Revision ID: james.westby@ubuntu.com-20090323000127-5fstfxju4ufrhthq
Tags: upstream-3.1~a1+20090322
ImportĀ upstreamĀ versionĀ 3.1~a1+20090322

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python
 
2
#
 
3
# test_codecencodings_tw.py
 
4
#   Codec encoding tests for ROC encodings.
 
5
#
 
6
 
 
7
from test import support
 
8
from test import test_multibytecodec_support
 
9
import unittest
 
10
 
 
11
class Test_Big5(test_multibytecodec_support.TestBase, unittest.TestCase):
 
12
    encoding = 'big5'
 
13
    tstring = test_multibytecodec_support.load_teststring('big5')
 
14
    codectests = (
 
15
        # invalid bytes
 
16
        (b"abc\x80\x80\xc1\xc4", "strict",  None),
 
17
        (b"abc\xc8", "strict",  None),
 
18
        (b"abc\x80\x80\xc1\xc4", "replace", "abc\ufffd\u8b10"),
 
19
        (b"abc\x80\x80\xc1\xc4\xc8", "replace", "abc\ufffd\u8b10\ufffd"),
 
20
        (b"abc\x80\x80\xc1\xc4", "ignore",  "abc\u8b10"),
 
21
    )
 
22
 
 
23
def test_main():
 
24
    support.run_unittest(__name__)
 
25
 
 
26
if __name__ == "__main__":
 
27
    test_main()