a 8źdg$ć@sZddlZddlmZddlmZmZGdd„dƒZGdd„deeƒZGdd „d eeƒZdS) éN)Ś OrderedDict)ŚPyTestŚCTestc@sdeZdZdd„Zdd„Zdd„Zdd„Zd d „Zd d „Zd d„Z dd„Z dd„Z dd„Z dd„Z dS)Ś TestUnicodecCsd}| |”}| |d”dS)NõαΩz"\u03b1\u03a9"©ŚdumpsŚ assertEqual©ŚselfŚuŚj©rś7/usr/local/lib/python3.9/test/test_json/test_unicode.pyŚtest_encoding3 s zTestUnicode.test_encoding3cCs d}| |g”}| |d”dS)Nrz["\u03b1\u03a9"]rr rrrŚtest_encoding4s zTestUnicode.test_encoding4cCs(d}|j|dd}| |d |””dS)NrF©Z ensure_asciiz"{0}"©rr Śformatr rrrŚtest_encoding5szTestUnicode.test_encoding5cCs*d}|j|gdd}| |d |””dS)NrFrz["{0}"]rr rrrŚtest_encoding6szTestUnicode.test_encoding6cCs0d}| | |”d”| |j|ddd”dS)Nuš„ z"\ud834\udd20"Fru"š„ ")r r©r r rrrŚtest_big_unicode_encodesz#TestUnicode.test_big_unicode_encodecCs4d}| | d|d”|”| | d”|”dS)Nuzš„ xś"z"z\ud834\udd20x")r ŚloadsrrrrŚtest_big_unicode_decode#sz#TestUnicode.test_big_unicode_decodecCs8tddƒD](}t|ƒ}d |”}| | |”|”q dS)Nri’×z "\u{0:04x}")ŚrangeŚchrrr r)r Śir ŚsrrrŚtest_unicode_decode(s zTestUnicode.test_unicode_decodecCsJ| t| d”ƒt”| t| d”ƒt”| t| d”dƒt”dS)Nz""z"a"z["a"]r)r ŚtyperŚstr©r rrrŚtest_unicode_preservation.sz%TestUnicode.test_unicode_preservationcCs&| t|jd”| t|jdg”dS)Nshi)Ś assertRaisesŚ TypeErrorrr#rrrŚtest_bytes_encode3szTestUnicode.test_bytes_encodecCsÖdtjfdtjfdtjfdtjfdtjffD]F\}}dg}| |” |”}| |  ||”|”| |  |”|”q,|  t |j d”| |  d d ””d ”| |  d ”d ”| |  d ”d”| |  d”d”dS)Nzutf-8zutf-16bezutf-16lezutf-32bezutf-32leu aĀµā‚¬š„ s["€"]u"ā˜€"z utf-16-leuā˜€s5és7és57é9) ŚcodecsŚBOM_UTF8Ś BOM_UTF16_BEŚ BOM_UTF16_LEŚ BOM_UTF32_BEŚ BOM_UTF32_LErŚencoder rr%ŚUnicodeDecodeError)r ŚencodingZbomŚdataŚencodedrrrŚtest_bytes_decode7s"ū ’zTestUnicode.test_bytes_decodecCsŽd}gd¢}| | |”t|ƒ”| |j|dd„d|”|j|td}| |t|ƒ”| t|ƒt”| |j|tdd„dt|ƒ”dS)Nz?{"xkd":1, "kcw":2, "art":3, "hxm":4, "qrt":5, "pad":6, "hoy":7}))Zxkdé)Zkcwé)Zarté)Zhxmé)Zqrtr()Zpadé)Zhoyr)cSs|S©Nr©ŚxrrrŚWózATestUnicode.test_object_pairs_hook_with_unicode..)Śobject_pairs_hookcSsdSr<rr=rrrr?]r@)rAZ object_hook)r rŚevalrr!)r rŚpZodrrrŚ#test_object_pairs_hook_with_unicodeRs ’žz/TestUnicode.test_object_pairs_hook_with_unicodeN)Ś__name__Ś __module__Ś __qualname__rrrrrrr r$r'r6rDrrrrrsrc@s eZdZdS)Ś TestPyUnicodeN©rErFrGrrrrrHar@rHc@s eZdZdS)Ś TestCUnicodeNrIrrrrrJbr@rJ) r+Ś collectionsrZtest.test_jsonrrrrHrJrrrrŚs  [