관리-도구
편집 파일: test_errors.cpython-37.pyc
B VX�Y � @ sH d dl Z d dlZd dlmZ d dlZd dlmZmZ G dd� de�Z dS )� N)�TestCase)�u�bc @ s, e Zd Zdd� Zdd� Zdd� Zdd� Zd S ) � TestErrorsc C s$ ddddd�g}| � ttj|� d S )N�A)� � g @zD tuple)�ar �c)�d)ZassertRaises� TypeError�json�dumps)�self�data� r �O/opt/alt/python37/lib64/python3.7/site-packages/simplejson/tests/test_errors.py�test_string_keys_error s z!TestErrors.test_string_keys_errorc C s| d }yt �d� W n" t jk r4 t�� d }Y nX | �d� | �|jd� | �|jd� | �|j d� | �|j d� d S )Nz{} a b� zExpected JSONDecodeErrorr � )r �loads�JSONDecodeError�sys�exc_info�fail�assertEqual�lineno�colnoZ endlinenoZendcolno)r �errr r r �test_decode_error s zTestErrors.test_decode_errorc C sv d }xlt tfD ]`}yt�|d�� W n" tjk rF t�� d }Y nX | �d� | �|j d� | �|j d� qW d S )Nz {"asdf": "r zExpected JSONDecodeError� )r r r r r r r r r r r )r r �tr r r �test_scan_error s zTestErrors.test_scan_errorc C s� d }yt �d� W n" t jk r4 t�� d }Y nX | �d� t�|�}t�|�}| �|j |j � | �|j |j � | �|j|j� | �|j|j� d S )Nz{} a br zExpected JSONDecodeError) r r r r r r �pickler r �msg�doc�pos�end)r r �s�er r r �test_error_is_pickable% s z!TestErrors.test_error_is_pickableN)�__name__� __module__�__qualname__r r r"