File: D:/Python311/Lib/test/test_json/__pycache__/test_unicode.cpython-311.pyc
�
��Vc� � � � d dl Z d dlmZ d dlmZmZ G d� d� � Z G d� dee� � Z G d� d ee� � ZdS )
� N)�OrderedDict)�PyTest�CTestc �P � e Zd Zd� Zd� Zd� Zd� Zd� Zd� Zd� Z d� Z
d � Zd
� Zd� Z
dS )
�TestUnicodec �` � d}| � |� � }| � |d� � d S )N� αΩz"\u03b1\u03a9"��dumps�assertEqual��self�u�js �/D:\Python311\Lib\test\test_json\test_unicode.py�test_encoding3zTestUnicode.test_encoding3
s3 � �H���J�J�q�M�M������.�/�/�/�/�/� c �b � d}| � |g� � }| � |d� � d S )Nr z["\u03b1\u03a9"]r
r
s r �test_encoding4zTestUnicode.test_encoding4 s5 � �H���J�J��s�O�O������0�1�1�1�1�1r c � � d}| � |d�� � }| � |d� |� � � � d S )Nr F��ensure_asciiz"{0}"�r r �formatr
s r �test_encoding5zTestUnicode.test_encoding5 sD � �H���J�J�q�u�J�-�-������G�N�N�1�-�-�.�.�.�.�.r c � � d}| � |gd�� � }| � |d� |� � � � d S )Nr Fr z["{0}"]r r
s r �test_encoding6zTestUnicode.test_encoding6 sH � �H���J�J��s��J�/�/������I�,�,�Q�/�/�0�0�0�0�0r c � � d}| � | � |� � d� � | � | � |d�� � d� � d S )Nu 𝄠z"\ud834\udd20"Fr u "𝄠")r r �r r s r �test_big_unicode_encodez#TestUnicode.test_big_unicode_encode sT � ���������A���(:�;�;�;�������A�E��:�:�N�K�K�K�K�Kr c � � d}| � | � d|z dz � � |� � | � | � d� � |� � d S )Nu z𝄠x�"z"z\ud834\udd20x")r �loadsr s r �test_big_unicode_decodez#TestUnicode.test_big_unicode_decode# sZ � ���������C�!�G�c�M�2�2�A�6�6�6�������$8�9�9�1�=�=�=�=�=r c �� � t dd� � D ]O}t |� � }d� |� � }| � | � |� � |� � �Pd S )Nr i�� z"\u{0:04x}")�range�chrr r r# )r �ir �ss r �test_unicode_decodezTestUnicode.test_unicode_decode( sf � ��q�&�!�!� /� /�A��A���A��%�%�a�(�(�A����T�Z�Z��]�]�A�.�.�.�.� /� /r c �t � | � t | � d� � � � t � � | � t | � d� � � � t � � | � t | � d� � d � � t � � d S )Nz""z"a"z["a"]r )r �typer# �str�r s r �test_unicode_preservationz%TestUnicode.test_unicode_preservation. s� � �����d�j�j��.�.�/�/��5�5�5�����d�j�j��/�/�0�0�#�6�6�6�����d�j�j��1�1�!�4�5�5�s�;�;�;�;�;r c � � | � t | j d� � | � t | j dg� � d S )Ns hi)�assertRaises� TypeErrorr r. s r �test_bytes_encodezTestUnicode.test_bytes_encode3 s>