**.zip = BIN
Lib/email/test/data/msg_26.txt = BIN
-Lib/test/sndhdrdata/sndhdr.* = BIN
+Lib/test/cjkencodings/* = BIN
Lib/test/decimaltestdata/*.decTest = BIN
+Lib/test/sndhdrdata/sndhdr.* = BIN
# All other files (which presumably are human-editable) are "native".
# This must be the last rule!
# Common Unittest Routines for CJK codecs
#
-import sys, codecs
-import unittest, re
+import codecs
+import os
+import re
+import sys
+import unittest
from httplib import HTTPException
from test import test_support
from StringIO import StringIO
self.fail('Decoding failed while testing %s -> %s: %s' % (
repr(csetch), repr(unich), exc.reason))
-def load_teststring(encoding):
- from test import cjkencodings_test
- return cjkencodings_test.teststring[encoding]
+def load_teststring(name):
+ dir = os.path.join(os.path.dirname(__file__), 'cjkencodings')
+ with open(os.path.join(dir, name + '.txt'), 'rb') as f:
+ encoded = f.read()
+ with open(os.path.join(dir, name + '-utf8.txt'), 'rb') as f:
+ utf8 = f.read()
+ return encoded, utf8