summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_charmapcodec.py
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2007-05-23 19:00:48 (GMT)
committerWalter Dörwald <walter@livinglogic.de>2007-05-23 19:00:48 (GMT)
commiteab198d2298a7186ae0a18382a12c864a4bb59a3 (patch)
treebaa227c15d71c761402f43213a01f05af2f8b7a2 /Lib/test/test_charmapcodec.py
parente53309ce4715262e9dcb6fb09177d61dcdb86c41 (diff)
downloadcpython-eab198d2298a7186ae0a18382a12c864a4bb59a3.zip
cpython-eab198d2298a7186ae0a18382a12c864a4bb59a3.tar.gz
cpython-eab198d2298a7186ae0a18382a12c864a4bb59a3.tar.bz2
Fix testcodec.py and test_charmapcodec.py
Diffstat (limited to 'Lib/test/test_charmapcodec.py')
-rw-r--r--Lib/test/test_charmapcodec.py30
1 files changed, 15 insertions, 15 deletions
diff --git a/Lib/test/test_charmapcodec.py b/Lib/test/test_charmapcodec.py
index d5981be..5e4055e 100644
--- a/Lib/test/test_charmapcodec.py
+++ b/Lib/test/test_charmapcodec.py
@@ -27,27 +27,27 @@ codecname = 'testcodec'
class CharmapCodecTest(unittest.TestCase):
def test_constructorx(self):
- self.assertEquals(str('abc', codecname), 'abc')
- self.assertEquals(str('xdef', codecname), 'abcdef')
- self.assertEquals(str('defx', codecname), 'defabc')
- self.assertEquals(str('dxf', codecname), 'dabcf')
- self.assertEquals(str('dxfx', codecname), 'dabcfabc')
+ self.assertEquals(str(b'abc', codecname), 'abc')
+ self.assertEquals(str(b'xdef', codecname), 'abcdef')
+ self.assertEquals(str(b'defx', codecname), 'defabc')
+ self.assertEquals(str(b'dxf', codecname), 'dabcf')
+ self.assertEquals(str(b'dxfx', codecname), 'dabcfabc')
def test_encodex(self):
- self.assertEquals('abc'.encode(codecname), 'abc')
- self.assertEquals('xdef'.encode(codecname), 'abcdef')
- self.assertEquals('defx'.encode(codecname), 'defabc')
- self.assertEquals('dxf'.encode(codecname), 'dabcf')
- self.assertEquals('dxfx'.encode(codecname), 'dabcfabc')
+ self.assertEquals('abc'.encode(codecname), b'abc')
+ self.assertEquals('xdef'.encode(codecname), b'abcdef')
+ self.assertEquals('defx'.encode(codecname), b'defabc')
+ self.assertEquals('dxf'.encode(codecname), b'dabcf')
+ self.assertEquals('dxfx'.encode(codecname), b'dabcfabc')
def test_constructory(self):
- self.assertEquals(str('ydef', codecname), 'def')
- self.assertEquals(str('defy', codecname), 'def')
- self.assertEquals(str('dyf', codecname), 'df')
- self.assertEquals(str('dyfy', codecname), 'df')
+ self.assertEquals(str(b'ydef', codecname), 'def')
+ self.assertEquals(str(b'defy', codecname), 'def')
+ self.assertEquals(str(b'dyf', codecname), 'df')
+ self.assertEquals(str(b'dyfy', codecname), 'df')
def test_maptoundefined(self):
- self.assertRaises(UnicodeError, str, 'abc\001', codecname)
+ self.assertRaises(UnicodeError, str, b'abc\001', codecname)
def test_main():
test.test_support.run_unittest(CharmapCodecTest)