HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.7/test/test_json/__pycache__/test_fail.cpython-37.opt-2.pyc
B

��gQ#�"@s�ddlmZmZdddddddd	d
ddd
ddddddddddddddddddd d!d"d#g"Zd$d%d&�ZGd'd(�d(�ZGd)d*�d*ee�ZGd+d,�d,ee�Zd-S).�)�PyTest�CTestz<"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@sDeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)�TestFailc	Csnxhtt�D]\\}}|d}|tkr.|�|�q
y|�|�Wn|jk
rRYq
X|�d�||��q
WdS)Nrz(Expected failure for fail{0}.json: {1!r})�	enumerate�JSONDOCS�SKIPS�loads�JSONDecodeErrorZfail�format)�self�idx�doc�r�4/usr/local/lib/python3.7/test/test_json/test_fail.py�
test_failuresQs
zTestFail.test_failuresc	Cs0ddd�}|�td��|�|�WdQRXdS)Nr�)�a)rrz5keys must be str, int, float, bool or None, not tuple)�assertRaisesRegex�	TypeError�dumps)r
�datarrr�test_non_string_keys_dict^s
z"TestFail.test_non_string_keys_dictc	Cs.ddl}|�td��|�|�WdQRXdS)Nrz.Object of type module is not JSON serializable)�sysrrr)r
rrrr�test_not_serializabledszTestFail.test_not_serializablecCs�ddddddddd	d
ddd
ddg}|ddg7}x�|D]�\}}}|�|j��}|�|�WdQRX|j}|�|j|�|�|j|�|�|jd�|�|j|d�|�t	|�d||d|f�q4WdS)N)�zExpecting valuer)�[zExpecting valuer)z[42zExpecting ',' delimiter�)z[42,zExpecting value�)z["zUnterminated string starting atr)z["spamzUnterminated string starting atr)z["spam"zExpecting ',' delimiter�)z["spam",zExpecting value�)�{z1Expecting property name enclosed in double quotesr)z{"zUnterminated string starting atr)z{"spamzUnterminated string starting atr)z{"spam"zExpecting ':' delimiterr )z{"spam":zExpecting valuer!)z
{"spam":42zExpecting ',' delimiter�
)z{"spam":42,z1Expecting property name enclosed in double quotes�)�"zUnterminated string starting atr)z"spamzUnterminated string starting atrrz%s: line 1 column %d (char %d))
�assertRaisesrr
�	exception�assertEqual�msg�pos�lineno�colno�str)r
�
test_casesrr)r�cm�errrrr�test_truncated_inputjs:
zTestFail.test_truncated_inputcCs�ddddddddd	d
ddd
ddddddddg}x�|D]�\}}}|�|j��}|�|�WdQRX|j}|�|j|�|�|j|�|�|jd�|�|j|d�|�t	|�d||d|f�q4WdS)N)z[,zExpecting valuer)z
{"spam":[}zExpecting value�	)z[42:zExpecting ',' delimiterr)z
[42 "spam"zExpecting ',' delimiterr)z[42,]zExpecting valuer)z{"spam":[42}zExpecting ',' delimiterr$)z["]zUnterminated string starting atr)z["spam":zExpecting ',' delimiterr )z	["spam",]zExpecting valuer!)z{:z1Expecting property name enclosed in double quotesr)z{,z1Expecting property name enclosed in double quotesr)z{42z1Expecting property name enclosed in double quotesr)z[{]z1Expecting property name enclosed in double quotesr)z{"spam",zExpecting ':' delimiterr )z{"spam"}zExpecting ':' delimiterr )z	[{"spam"]zExpecting ':' delimiterr!)z	{"spam":}zExpecting valuer!)z
[{"spam":]zExpecting valuer2)z{"spam":42 "ham"zExpecting ',' delimiterr$)z[{"spam":42]zExpecting ',' delimiterr$)z{"spam":42,}z1Expecting property name enclosed in double quotesr$rz%s: line 1 column %d (char %d))
r&rr
r'r(r)r*r+r,r-)r
r.rr)rr/r0rrr�test_unexpected_data�s@
zTestFail.test_unexpected_datac
Cs�ddddg}|ddg7}x�|D]�\}}}|�|j��}|�|�WdQRX|j}|�|j|�|�|j|�|�|jd�|�|j|d�|�t	|�d||d|f�qWdS)	N)z[]]z
Extra datar)z{}}z
Extra datar)z[],[]z
Extra datar)z{},{}z
Extra datar)z	42,"spam"z
Extra datar)z	"spam",42z
Extra data�rz%s: line 1 column %d (char %d))
r&rr
r'r(r)r*r+r,r-)r
r.rr)rr/r0rrr�test_extra_data�s$
zTestFail.test_extra_datac
Cs�ddddg}x�|D]�\}}}}|�|j��}|�|�WdQRX|j}|�|jd�|�|j|�|�|j|�|�|j|�|�t	|�d|||f�qWdS)N)�!rrr)z !rrr)z
!rrr)z
  

     !rr4r#zExpecting valuez,Expecting value: line %s column %d (char %d))
r&rr
r'r(r)r*r+r,r-)r
r.r�line�colrr/r0rrr�test_linecol�s
zTestFail.test_linecolN)
�__name__�
__module__�__qualname__rrrr1r3r5r9rrrrrPs
"$rc@seZdZdS)�
TestPyFailN)r:r;r<rrrrr=�sr=c@seZdZdS)�	TestCFailN)r:r;r<rrrrr>�sr>N)Ztest.test_jsonrrrr	rr=r>rrrr�<module>sP