Exemple #1
0
def test_oounicode():
    u = ootype.oounicode(u'a', -1)
    assert isinstance(u, ootype._string)
    assert ootype.typeOf(u) is ootype.Unicode

    s = ootype.make_string('a string')
    u = ootype.oounicode(s, -1)
    assert isinstance(u, ootype._string)
    assert ootype.typeOf(u) is ootype.Unicode

    s = ootype.make_string('non-ascii string: \xe0')
    py.test.raises(UnicodeDecodeError, ootype.oounicode, s, -1)
Exemple #2
0
def test_oounicode():
    u = ootype.oounicode(u'a', -1)
    assert isinstance(u, ootype._string)
    assert ootype.typeOf(u) is ootype.Unicode

    s = ootype.make_string('a string')
    u = ootype.oounicode(s, -1)
    assert isinstance(u, ootype._string)
    assert ootype.typeOf(u) is ootype.Unicode

    s = ootype.make_string('non-ascii string: \xe0')
    py.test.raises(UnicodeDecodeError, ootype.oounicode, s, -1)
Exemple #3
0
 def ll_unichr2unicode(ch):
     return ootype.oounicode(ch, -1)
Exemple #4
0
 def ll_str2unicode(s):
     return ootype.oounicode(s, -1)
Exemple #5
0
 def _ll_1_oounicode_string_foldable(s):
     return ootype.oounicode(s, -1)
Exemple #6
0
 def _ll_1_oounicode_unichar_foldable(ch):
     return ootype.oounicode(ch, -1)
Exemple #7
0
 def _ll_2_oounicode_signed_foldable(n, base):
     return ootype.oounicode(n, base)
Exemple #8
0
 def _ll_1_oounicode_string_foldable(s):
     return ootype.oounicode(s, -1)
Exemple #9
0
 def _ll_1_oounicode_unichar_foldable(ch):
     return ootype.oounicode(ch, -1)
Exemple #10
0
 def _ll_2_oounicode_signed_foldable(n, base):
     return ootype.oounicode(n, base)
Exemple #11
0
 def ll_unichr2unicode(ch):
     return ootype.oounicode(ch, -1)
Exemple #12
0
 def ll_str2unicode(s):
     return ootype.oounicode(s, -1)
Exemple #13
0
 def to_runicode(u):
     return ootype.oounicode(u, -1)
Exemple #14
0
 def op_oounicode(self, obj, base):
     try:
         return ootype.oounicode(obj, base)
     except UnicodeDecodeError:
         self.make_llexception()
Exemple #15
0
 def op_oounicode(self, obj, base):
     try:
         return ootype.oounicode(obj, base)
     except UnicodeDecodeError:
         self.make_llexception()
Exemple #16
0
 def to_runicode(u):
     return ootype.oounicode(u, -1)