Sindbad~EG File Manager
�
)Μge# � �j � d dl mZmZ g d�Zddd�Z G d� d� Z G d� d ee� Z G d
� dee� Zy)
� )�PyTest�CTest)"z<"A JSON payload should be an object or array, not a string."z["Unclosed array"z%{unquoted_key: "keys must be quoted"}z["extra comma",]z["double extra comma",,]z[ , "<-- missing value"]z["Comma after the close"],z["Extra close"]]z{"Extra comma": true,}z:{"Extra value after close": true} "misplaced quoted value"z{"Illegal expression": 1 + 2}z{"Illegal invocation": alert()}z+{"Numbers cannot have leading zeroes": 013}z{"Numbers cannot be hex": 0x14}z"["Illegal backslash escape: \x15"]z[\naked]z"["Illegal backslash escape: \017"]z2[[[[[[[[[[[[[[[[[[[["Too deep"]]]]]]]]]]]]]]]]]]]]z{"Missing colon" null}z{"Double colon":: null}z {"Comma instead of colon", null}z!["Colon instead of comma": false]z["Bad value", truth]z['single quote']z[" tab character in string "]z&["tab\ character\ in\ string\ "]z["line
break"]z["line\
break"]z[0e]z[0e+]z[0e+-1]z({"Comma instead if closing brace": true,z["mismatch"}z$["AZ control characters in string"]zwhy not have a string payload?z,spec doesn't specify any nesting limitations)� � c �6 � e Zd Zd� Zd� Zd� Zd� Zd� Zd� Zd� Z y) �TestFailc �� � t t � D ]M \ }}|dz }|t v r| j |� �% | j |� | j d|� d|��� �O y # | j
$ r Y �bw xY w)Nr zExpected failure for failz.json: )� enumerate�JSONDOCS�SKIPS�loads�fail�JSONDecodeError)�self�idx�docs �5/usr/local/lib/python3.12/test/test_json/test_fail.py�
test_failureszTestFail.test_failuresQ sz � �!�(�+�H�C����'�C��e�|��
�
�3���
K��
�
�3�� � � �5�c�U�'�#��I�J� ,�� �'�'�
��
�s �A!�!A3�2A3c � � ddd�}| j t d� 5 | j |� d d d � y # 1 sw Y y xY w)Nr � )�a)r r z5keys must be str, int, float, bool or None, not tuple)�assertRaisesRegex� TypeError�dumps)r �datas r �test_non_string_keys_dictz"TestFail.test_non_string_keys_dict^ s? � ��!�$��
�
#�
#�I�G�I��J�J�t��I� I� I�s �7�A c � � dd l }| j t d� 5 | j |� d d d � y # 1 sw Y y xY w)Nr z.Object of type module is not JSON serializable)�sysr r r )r r s r �test_not_serializablezTestFail.test_not_serializabled s7 � ��
�
#�
#�I�@�B��J�J�s�O�B� B� B�s �6�?c � � g d�}|ddgz
}|D ]� \ }}}| j | j � 5 }| j |� d d d � j }| j |j
|� | j |j |� | j |j d� | j |j |dz � | j t |� d||dz |fz � �� y # 1 sw Y ��xY w)N))� �Expecting valuer )�[r"