a  ze$@sZddlZddlmZddlmZmZGdddZGdddeeZGdd d eeZdS) N) OrderedDict)PyTestCTestc@sdeZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ dS) TestUnicodecCsd}||}||ddS)NαΩz"\u03b1\u03a9"dumps assertEqualselfujrO/opt/bitninja-python-dojo/embedded/lib/python3.9/test/test_json/test_unicode.pytest_encoding3 s zTestUnicode.test_encoding3cCs d}||g}||ddS)Nrz["\u03b1\u03a9"]rr rrrtest_encoding4s zTestUnicode.test_encoding4cCs(d}|j|dd}||d|dS)NrFZ ensure_asciiz"{0}"rr formatr rrrtest_encoding5szTestUnicode.test_encoding5cCs*d}|j|gdd}||d|dS)NrFrz["{0}"]rr rrrtest_encoding6szTestUnicode.test_encoding6cCs0d}|||d||j|ddddS)Nu𝄠z"\ud834\udd20"Fru"𝄠")r rr r rrrtest_big_unicode_encodesz#TestUnicode.test_big_unicode_encodecCs4d}||d|d|||d|dS)Nuz𝄠x"z"z\ud834\udd20x")r loadsrrrrtest_big_unicode_decode#sz#TestUnicode.test_big_unicode_decodecCs8tddD](}t|}d|}||||q dS)Nriz "\u{0:04x}")rangechrrr r)r ir srrrtest_unicode_decode(s zTestUnicode.test_unicode_decodecCsJ|t|dt|t|dt|t|ddtdS)Nz""z"a"z["a"]r)r typerstrr rrrtest_unicode_preservation.sz%TestUnicode.test_unicode_preservationcCs&|t|jd|t|jdgdS)Nshi) assertRaises TypeErrorrr#rrrtest_bytes_encode3szTestUnicode.test_bytes_encodecCsdtjfdtjfdtjfdtjfdtjffD]F\}}dg}|||}|| ||||| ||q,| t |j d|| dd d || d d || d d|| dddS)Nzutf-8zutf-16bezutf-16lezutf-32bezutf-32leu aµ€𝄠s[""]u"☀"z utf-16-leu☀s5s7s579) codecsBOM_UTF8 BOM_UTF16_BE BOM_UTF16_LE BOM_UTF32_BE BOM_UTF32_LErencoder rr%UnicodeDecodeError)r encodingZbomdataencodedrrrtest_bytes_decode7s" zTestUnicode.test_bytes_decodecCsd}gd}|||t|||j|ddd||j|td}||t||t|t||j|tdddt|dS)Nz?{"xkd":1, "kcw":2, "art":3, "hxm":4, "qrt":5, "pad":6, "hoy":7}))Zxkd)Zkcw)Zart)Zhxm)Zqrtr()Zpad)Zhoyr)cSs|SNrxrrrWzATestUnicode.test_object_pairs_hook_with_unicode..)object_pairs_hookcSsdSr<rr=rrrr?]r@)rAZ object_hook)r revalrr!)r rpZodrrr#test_object_pairs_hook_with_unicodeRs z/TestUnicode.test_object_pairs_hook_with_unicodeN)__name__ __module__ __qualname__rrrrrrr r$r'r6rDrrrrrsrc@s eZdZdS) TestPyUnicodeNrErFrGrrrrrHar@rHc@s eZdZdS) TestCUnicodeNrIrrrrrJbr@rJ) r+ collectionsrZtest.test_jsonrrrrHrJrrrrs  [