Lines Matching refs:codecname
26 codecname = 'testcodec'
30 self.assertEqual(unicode('abc', codecname), u'abc')
31 self.assertEqual(unicode('xdef', codecname), u'abcdef')
32 self.assertEqual(unicode('defx', codecname), u'defabc')
33 self.assertEqual(unicode('dxf', codecname), u'dabcf')
34 self.assertEqual(unicode('dxfx', codecname), u'dabcfabc')
37 self.assertEqual(u'abc'.encode(codecname), 'abc')
38 self.assertEqual(u'xdef'.encode(codecname), 'abcdef')
39 self.assertEqual(u'defx'.encode(codecname), 'defabc')
40 self.assertEqual(u'dxf'.encode(codecname), 'dabcf')
41 self.assertEqual(u'dxfx'.encode(codecname), 'dabcfabc')
44 self.assertEqual(unicode('ydef', codecname), u'def')
45 self.assertEqual(unicode('defy', codecname), u'def')
46 self.assertEqual(unicode('dyf', codecname), u'df')
47 self.assertEqual(unicode('dyfy', codecname), u'df')
50 self.assertRaises(UnicodeError, unicode, 'abc\001', codecname)