Add a testcase for r47086 which fixed a bug in codec_getstreamcodec().

This commit is contained in:
Hye-Shik Chang 2006-07-06 15:21:52 +00:00
parent 653f23cc81
commit 84392bee48
1 changed files with 9 additions and 1 deletions

View File

@ -6,7 +6,8 @@
from test import test_support from test import test_support
from test import test_multibytecodec_support from test import test_multibytecodec_support
import unittest, StringIO, codecs, sys from test.test_support import TESTFN
import unittest, StringIO, codecs, sys, os
class Test_MultibyteCodec(unittest.TestCase): class Test_MultibyteCodec(unittest.TestCase):
@ -25,6 +26,13 @@ class Test_MultibyteCodec(unittest.TestCase):
self.assertRaises(IndexError, dec, self.assertRaises(IndexError, dec,
'apple\x92ham\x93spam', 'test.cjktest') 'apple\x92ham\x93spam', 'test.cjktest')
def test_codingspec(self):
print >> open(TESTFN, 'w'), '# coding: euc-kr'
try:
exec open(TESTFN)
finally:
os.unlink(TESTFN)
class Test_IncrementalEncoder(unittest.TestCase): class Test_IncrementalEncoder(unittest.TestCase):
def test_stateless(self): def test_stateless(self):