Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/simplejson/tests/__pycache__/test_fail.cpython-39.pyc
Ðазад
a `�h6 � @ sB d dl Z d dlmZ d dlZg d�Zddd�ZG dd� de�ZdS ) � N)�TestCase):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"]�{z{]z{"foo": "bar"]z {"foo": "bar"�nulZnulx�-z-xz-ez-e0z -Infinitez-InfZInfinitZInfiniteZNaMZNuNZfalsyZfalZtrugZtruZ1eZ1exz1e-z1e-xzwhy not have a string payload?z,spec doesn't specify any nesting limitations)� � c @ s$ e Zd Zdd� Zdd� Zdd� ZdS )�TestFailc C sh t t�D ]Z\}}|d }|tv r,t�|� qzt�|� W n tjyN Y q0 | �d||f � qd S )Nr z$Expected failure for fail%d.json: %r)� enumerate�JSONDOCS�SKIPS�json�loads�JSONDecodeError�fail)�self�idx�doc� r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/simplejson/tests/test_fail.py� test_failuresm s zTestFail.test_failuresc C s� dD ]�}zt �|� W nx t jy` t�� d }| �|jd� | �|jd� | �|jd� Y q t y� t�� d }| � d||f � Y q0 | � d� qd S )N)�[,]r r � �!Unexpected exception raised %r %sz Unexpected success parsing '[,]')r r r �sys�exc_info�assertEqual�pos�lineno�colno� Exceptionr )r r �er r r �test_array_decoder_issue46z s z#TestFail.test_array_decoder_issue46c C s� g d�}|D ]�\}}}zt �|� W n� t jy� t�� d }| �|jd t|�� |d|j||f � | �|j|d|j||f � Y q t y� t�� d }| � d||f � Y q0 | � d|f � qd S )N))� �Expecting valuer )�[zExpecting value or ']'r )z[42�Expecting ',' delimiter� )z[42,r# � )z["�Unterminated string starting atr )z["spamr( r )z["spam"r% � )z["spam",r# � )r z8Expecting property name enclosed in double quotes or '}'r )z{"r( r )z{"spamr( r )z{"spam"zExpecting ':' delimiterr) )z{"spam":r# r* )z {"spam":42r% � )z{"spam":42,z1Expecting property name enclosed in double quotes� )�"r( r )z"spamr( r )z[,r# r )z--r# r )z"dzInvalid control character %rr r z%r doesn't start with %r for %rzpos %r != %r for %rr zUnexpected success parsing '%r')r r r r r r �msg�lenr r r )r Z test_cases�datar. r r r r r �test_truncated_input� s&