Пример #1
0
def test_utf_16_ex_decode():
    '''
    '''
    #sanity
    new_str, size, zero = codecs.utf_16_ex_decode("abc")
    AreEqual(new_str, u'\u6261')
    AreEqual(size, 2)
    AreEqual(zero, 0)
Пример #2
0
def test_utf_16_ex_decode():
    '''
    '''
    #sanity
    new_str, size, zero = codecs.utf_16_ex_decode("abc")
    AreEqual(new_str, u'\u6261')
    AreEqual(size, 2)
    AreEqual(zero, 0)
Пример #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)