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.10/test/test_json/__pycache__/test_fail.cpython-310.pyc
o

�iq#�@sXddlmZmZgd�Zddd�ZGdd�d�ZGdd	�d	ee�ZGd
d�dee�ZdS)
�)�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@sDeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)�TestFailc	Cshtt�D]-\}}|d}|tvr|�|�qz|�|�Wn
|jy'Yqw|�d�||��qdS)Nrz(Expected failure for fail{0}.json: {1!r})�	enumerate�JSONDOCS�SKIPS�loads�JSONDecodeErrorZfail�format)�self�idx�doc�r�5/usr/local/lib/python3.10/test/test_json/test_fail.py�
test_failuresQs
��zTestFail.test_failurescCsFddd�}|�td��|�|�Wd�dS1swYdS)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_dictcCsDddl}|�td��|�|�Wd�dS1swYdS)Nrz.Object of type module is not JSON serializable)�sysrrr)r
rrrr�test_not_serializableds�"�zTestFail.test_not_serializablec	C�gd�}|ddg7}|D]P\}}}|�|j��
}|�|�Wd�n1s'wY|j}|�|j|�|�|j|�|�|jd�|�|j|d�|�t	|�d||d|f�qdS)N))��Expecting valuer)�[rr)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":rr%)z
{"spam":42r �
)z{"spam":42,r'�)�"r#r)z"spamr#rr�%s: line 1 column %d (char %d)�
ZassertRaisesrr
�	exceptionZassertEqual�msg�pos�lineno�colno�str�r
�
test_casesrr/r�cm�errrrr�test_truncated_inputjs(��
���zTestFail.test_truncated_inputc	Cs�gd�}|D]P\}}}|�|j��
}|�|�Wd�n1s!wY|j}|�|j|�|�|j|�|�|jd�|�|j|d�|�t	|�d||d|f�qdS)N))z[,rr)z
{"spam":[}r�	)z[42:r r!)z
[42 "spam"r r")z[42,]rr")z{"spam":[42}r r*)z["]r#r)z["spam":r r$)z	["spam",]rr%)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":}rr%)z
[{"spam":]rr9)z{"spam":42 "ham"r r*)z[{"spam":42]r r*)z{"spam":42,}r'r*rr,r-r4rrr�test_unexpected_data�s �
���zTestFail.test_unexpected_datac	Cr)N))z[]]�
Extra datar)z{}}r;r)z[],[]r;r)z{},{}r;r)z	42,"spam"r;r)z	"spam",42r;�rr,r-r4rrr�test_extra_data�s(��
���zTestFail.test_extra_datac	Cs�gd�}|D]M\}}}}|�|j��
}|�|�Wd�n1s"wY|j}|�|jd�|�|j|�|�|j|�|�|j|�|�t	|�d|||f�qdS)N))�!rrr)z !rrr)z
!rrr)z
  

     !r"r<r)rz,Expecting value: line %s column %d (char %d)r-)r
r5r�line�colrr6r7rrr�test_linecol�s �
���zTestFail.test_linecolN)
�__name__�
__module__�__qualname__rrrr8r:r=rArrrrrPs
"$rc@�eZdZdS)�
TestPyFailN�rBrCrDrrrrrF��rFc@rE)�	TestCFailNrGrrrrrI�rHrIN)Ztest.test_jsonrrrr	rrFrIrrrr�<module>sH�