示例#1
0
文件: codecs_test.py 项目: mdavid/dlr
def test_ascii_decode():
    '''
    '''
    #sanity
    new_str, size = codecs.ascii_decode("abc")
    AreEqual(new_str, u'abc')
    AreEqual(size, 3)
示例#2
0
def test_ascii_decode():
    '''
    '''
    #sanity
    new_str, size = codecs.ascii_decode("abc")
    AreEqual(new_str, u'abc')
    AreEqual(size, 3)
示例#3
0
 def test_decode_bytearray(self):
     import _codecs
     b = bytearray()
     assert _codecs.ascii_decode(b) == (u'', 0)
     assert _codecs.latin_1_decode(b) == (u'', 0)
     assert _codecs.utf_7_decode(b) == (u'', 0)
     assert _codecs.utf_8_decode(b) == (u'', 0)
     assert _codecs.utf_16_be_decode(b) == (u'', 0)
     assert _codecs.utf_16_decode(b) == (u'', 0)
     assert _codecs.utf_16_le_decode(b) == (u'', 0)
     assert _codecs.utf_16_ex_decode(b) == (u'', 0, 0)
     assert _codecs.utf_32_decode(b) == (u'', 0)
     assert _codecs.utf_32_be_decode(b) == (u'', 0)
     assert _codecs.utf_32_le_decode(b) == (u'', 0)
     assert _codecs.utf_32_ex_decode(b) == (u'', 0, 0)
     assert _codecs.charmap_decode(b) == (u'', 0)
     assert _codecs.unicode_escape_decode(b) == (u'', 0)
     assert _codecs.raw_unicode_escape_decode(b) == (u'', 0)
     assert _codecs.unicode_internal_decode(b) == (u'', 0)
示例#4
0
 def test_decode_bytearray(self):
     import _codecs
     b = bytearray()
     assert _codecs.ascii_decode(b) == (u'', 0)
     assert _codecs.latin_1_decode(b) == (u'', 0)
     assert _codecs.utf_7_decode(b) == (u'', 0)
     assert _codecs.utf_8_decode(b) == (u'', 0)
     assert _codecs.utf_16_be_decode(b) == (u'', 0)
     assert _codecs.utf_16_decode(b) == (u'', 0)
     assert _codecs.utf_16_le_decode(b) == (u'', 0)
     assert _codecs.utf_16_ex_decode(b) == (u'', 0, 0)
     assert _codecs.utf_32_decode(b) == (u'', 0)
     assert _codecs.utf_32_be_decode(b) == (u'', 0)
     assert _codecs.utf_32_le_decode(b) == (u'', 0)
     assert _codecs.utf_32_ex_decode(b) == (u'', 0, 0)
     assert _codecs.charmap_decode(b) == (u'', 0)
     assert _codecs.unicode_escape_decode(b) == (u'', 0)
     assert _codecs.raw_unicode_escape_decode(b) == (u'', 0)
     assert _codecs.unicode_internal_decode(b) == (u'', 0)