pypy/module/array/test/test_array.py::AppTestArrayReconstructor::()::test_unicode
self = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0x000001bb2805a250>
def test_unicode(self):
import array
array_reconstructor = array._array_reconstructor
UTF16_LE = 18
UTF16_BE = 19
UTF32_LE = 20
UTF32_BE = 21
teststr = "Bonne Journ\xe9e \U0002030a\U00020347"
testcases = (
(UTF16_LE, "UTF-16-LE"),
(UTF16_BE, "UTF-16-BE"),
(UTF32_LE, "UTF-32-LE"),
(UTF32_BE, "UTF-32-BE")
)
for testcase in testcases:
mformat_code, encoding = testcase
a = array.array('u', teststr)
b = array_reconstructor(
array.array, 'u', mformat_code, teststr.encode(encoding))
> assert a == b
E (application-level) AssertionError
[d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\array\test\test_array.py:1272]:20: AssertionError
builder: own-win-x86-64 build #2236
test: pypy/module/array/test/test_array/py/AppTestArrayReconstructor/()/test_unicode