관리-도구
편집 파일: test_decimal.cpython-37.pyc
B VX�Y� � @ sL d dl Z d dl ma d dlmZ d dlmZmZ d dlZG dd� de�Z dS )� N)�Decimal)�TestCase)�StringIO� reload_modulec @ sP e Zd ZdZdd� Zdd� Zdd� Zdd � Zd d� Zdd � Z dd� Z dd� ZdS )�TestDecimal)z1.0z10.00z1.1z1234567890.1234567890�500c K s8 t � }tj||f|� tj|f|�}| �||�� � |S )N)r �json�dump�dumps�assertEqual�getvalue)�self�obj�kw�sio�res� r �P/opt/alt/python37/lib64/python3.7/site-packages/simplejson/tests/test_decimal.pyr s zTestDecimal.dumpsc K s0 t |�}tj|f|�}| �|tj|f|�� |S )N)r r �loadsr �load)r �sr r r r r r r s zTestDecimal.loadsc C s4 x.t t| j�D ]}| �| j|dd�t|�� qW d S )NT)�use_decimal)�mapr �NUMSr r �str)r �dr r r �test_decimal_encode s zTestDecimal.test_decimal_encodec C s. x(| j D ]}| �| j|td�t|�� qW d S )N)�parse_float)r r r r )r r r r r �test_decimal_decode s zTestDecimal.test_decimal_decodec C sJ xDt t| j�D ]4}||i}| �| j| j|dd�td�t|�|i� qW d S )NT)r )r )r r r r r r r )r r �vr r r �test_stringify_key s zTestDecimal.test_stringify_keyc C sT xNt t| j�D ]>}x8||gd|igD ]$}| �| j| j|dd�td�|� q$W qW d S )N� T)r )r )r r r r r r )r r r r r r �test_decimal_roundtrip'