관리-도구
편집 파일: test_float.cpython-37.opt-1.pyc
B VX�Y� � @ sT d dl Z d dlmZ d dlmZmZ d dlZd dlm Z m Z mZ G dd� de�ZdS )� N)�TestCase)� long_type� text_type)�NaN�PosInf�NegInfc @ s4 e Zd Zdd� Zdd� Zdd� Zdd� Zd d � ZdS )� TestFloatc C sP x(t tfD ]}| �t�t�|��|� q W t�t�t��}| �d| |k� d S )Nr )r r �assertEqual�json�loads�dumpsr Z assertTrue)�self�inf�nan� r �N/opt/alt/python37/lib64/python3.7/site-packages/simplejson/tests/test_float.py�test_degenerates_allow s z TestFloat.test_degenerates_allowc C s4 x.t ttfD ] }| �t�tj|dd��d � qW d S )NT)Z ignore_nan)r r r r r r r )r �fr r r �test_degenerates_ignore s z!TestFloat.test_degenerates_ignorec C s, x&t ttfD ]}| jttj|dd� qW d S )NF)Z allow_nan)r r r ZassertRaises� ValueErrorr r )r r r r r �test_degenerates_deny s zTestFloat.test_degenerates_denyc C st xndt jt jd t jd dgD ]N}| �tt�|��|� | �t�t�|��|� | �t�tt�|���|� qW d S )Ng���A�d i����g������@)�math�pir �floatr r r r )r �numr r r �test_floats s zTestFloat.test_floatsc C s~ xxdt d�ddgD ]d}| �t�|�t|�� | �tt�|��|� | �t�t�|��|� | �t�tt�|���|� qW d S )N� l l )r r r r �str�intr r )r r r r r � test_ints s zTestFloat.test_intsN)�__name__� __module__�__qualname__r r r r r r r r r r s r ) r Zunittestr Zsimplejson.compatr r Z simplejsonr Zsimplejson.decoderr r r r r r r r �<module> s