Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.12/test/test_json/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.12/test/test_json/__pycache__/test_fail.cpython-312.pyc

�

)Μge#��j�ddlmZmZgd�Zddd�ZGd�d�ZGd�d	ee�ZGd
�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�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	y)	�TestFailc���tt�D]M\}}|dz}|tvr|j|��%	|j|�|j	d|�d|����Oy#|j
$rY�bwxYw)NrzExpected 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_failuresQsz��!�(�+�H�C����'�C��e�|��
�
�3���
K��
�
�3���	�	�5�c�U�'�#��I�J�,���'�'�
��
�s�A!�!A3�2A3c��ddd�}|jtd�5|j|�ddd�y#1swYyxYw)Nr�)�a)rrz5keys 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�Ac��ddl}|jtd�5|j|�ddd�y#1swYyxYw)Nrz.Object of type module is not JSON serializable)�sysrrr)rrs  r�test_not_serializablezTestFail.test_not_serializableds7���
�
#�
#�I�@�B��J�J�s�O�B�B�B�s�6�?c��gd�}|ddgz
}|D]�\}}}|j|j�5}|j|�ddd�j}|j	|j
|�|j	|j|�|j	|jd�|j	|j|dz�|j	t|�d||dz|fz���y#1swY��xYw)N))��Expecting valuer)�[r"r)z[42�Expecting ',' delimiter�)z[42,r"�)z["�Unterminated string starting atr)z["spamr'r)z["spam"r$�)z["spam",r"�)�{�1Expecting property name enclosed in double quotesr)z{"r'r)z{"spamr'r)z{"spam"�Expecting ':' delimiterr()z{"spam":r"r))z
{"spam":42r$�
)z{"spam":42,r+�)�"r'r)z"spamr'rr�%s: line 1 column %d (char %d)�
�assertRaisesrr
�	exception�assertEqual�msg�pos�lineno�colno�str�r�
test_casesrr5r�cm�errs       r�test_truncated_inputzTestFail.test_truncated_inputjs���
�
�"	�7�;�
�	
�
�)�N�D�#�s��"�"�4�#7�#7�8�B��
�
�4� �9��,�,�C����S�W�W�c�*����S�W�W�c�*����S�Z�Z��+����S�Y�Y��a��0����S��X�=�!�3��7�C�0�1�
2�)�8�8���C0�0C9	c���gd�}|D]�\}}}|j|j�5}|j|�ddd�j}|j	|j
|�|j	|j|�|j	|jd�|j	|j|dz�|j	t|�d||dz|fz���y#1swY��xYw)N))z[,r"r)z
{"spam":[}r"�	)z[42:r$r%)z
[42 "spam"r$r&)z[42,]r"r&)z{"spam":[42}r$r.)z["]r'r)z["spam":r$r()z	["spam",]r"r))z{:r+r)z{,r+r)z{42r+r)z[{]r+r)z{"spam",r,r()z{"spam"}r,r()z	[{"spam"]r,r))z	{"spam":}r"r))z
[{"spam":]r"rA)z{"spam":42 "ham"r$r.)z[{"spam":42]r$r.)z{"spam":42,}r+r.rr0r1r:s       r�test_unexpected_datazTestFail.test_unexpected_data�s���
�
�.)�N�D�#�s��"�"�4�#7�#7�8�B��
�
�4� �9��,�,�C����S�W�W�c�*����S�W�W�c�*����S�Z�Z��+����S�Y�Y��a��0����S��X�=�!�3��7�C�0�1�
2�)�8�8�s�C)�)C2	c��gd�}|ddgz
}|D]�\}}}|j|j�5}|j|�ddd�j}|j	|j
|�|j	|j|�|j	|jd�|j	|j|dz�|j	t|�d||dz|fz���y#1swY��xYw)N))z[]]�
Extra datar)z{}}rDr)z[],[]rDr)z{},{}rDr)z	42,"spam"rDr)z	"spam",42rD�rr0r1r:s       r�test_extra_datazTestFail.test_extra_data�s���
�
�	�*�*�
�	
�
�)�N�D�#�s��"�"�4�#7�#7�8�B��
�
�4� �9��,�,�C����S�W�W�c�*����S�W�W�c�*����S�Z�Z��+����S�Y�Y��a��0����S��X�=�!�3��7�C�0�1�
2�)�8�8�r?c���gd�}|D]�\}}}}|j|j�5}|j|�ddd�j}|j	|j
d�|j	|j|�|j	|j|�|j	|j|�|j	t|�d|||fz���y#1swY��xYw)N))�!rrr)z !rrr)z
!rrr)z
  

     !r&rEr-r"z,Expecting value: line %s column %d (char %d)r1)rr;r�line�colrr<r=s        r�test_linecolzTestFail.test_linecol�s���
�
�%/� �D�$��S��"�"�4�#7�#7�8�B��
�
�4� �9��,�,�C����S�W�W�&7�8����S�W�W�c�*����S�Z�Z��.����S�Y�Y��,����S��X�K�"�C��-�.�
/�%/�8�8�s�C$�$C-	N)
�__name__�
__module__�__qualname__rrrr>rBrFrK��rrrPs(��K��� 2�D"2�H2�./rPrc��eZdZy)�
TestPyFailN�rLrMrNrOrPrrRrR���rPrRc��eZdZy)�	TestCFailNrSrOrPrrVrV�rTrPrVN)�test.test_jsonrrrrrrRrVrOrPr�<module>rXsC��(�E��P(�6�	��
H/�H/�T)��6�(�&��%�&rP

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists