3
dR                 @   sZ   d dl mZmZmZmZ d dlZddlmZmZm	Z	m
Z
 G dd dZG dd deZdS )	    )print_functionabsolute_importdivisionunicode_literalsN   )
round_tripdedentround_trip_loadround_trip_dumpc               @   s,   e Zd Zdd Zdd Zdd Zdd Zd	S )
	TestFloatc             C   s  t d}t| d|d   k o&dk n  s0td|d   k oFdk n  sPtd|d   k ofdk n  sptd|d	    k odk n  std|d
    k odk n  std|d    k odk n  std|d   k odk n  std|d    k odk n  std|d   k o4dk n  s@td|d   k oXdk n  sdtd|d   k o|dk n  std|d   k odk n  std S )Nz        - 1.0
        - 1.00
        - 23.100
        - -1.0
        - -1.00
        - -23.100
        - 42.
        - -42.
        - +42.
        - .5
        - +.5
        - -.5
        g+?r   gjt?r   gMbX7@   g`"7@         gZd;D@   g㥛  E@      g\(\?	   gRQ?
      gRQg\(\߿)r   printAssertionError)selfdata r   V/var/www/html/virt/lib64/python3.6/site-packages/srsly/tests/ruamel_yaml/test_float.pytest_round_trip_non_exp   s       """ &$$$z!TestFloat.test_round_trip_non_expc             C   s>   t d}t| x(|D ] }d|  k o,dk n  stqW d S )Nz        - 0.
        - +0.
        - -0.
        - 0.0
        - +0.0
        - -0.0
        - 0.00
        - +0.00
        - -0.00
        gh㈵>gh㈵)r   r   r   )r   r   dr   r   r   test_round_trip_zeros_0,   s
    
z!TestFloat.test_round_trip_zeros_0c             C   s   t d}t| d S )Nz        )r   r   )r   r   r   r   r   %Xtest_round_trip_non_exp_trailing_dot>   s    z/TestFloat.Xtest_round_trip_non_exp_trailing_dotc          	   C   s.   ddl m} tj| td W d Q R X d S )Nr   )MantissaNoDotYAML1_1WarningzD            %YAML 1.1
            ---
            - 1e6
            )Zsrsly.ruamel_yaml.errorr    pytestZwarnsr	   )r   r    r   r   r   test_yaml_1_1_no_dotE   s    zTestFloat.test_yaml_1_1_no_dotN)__name__
__module____qualname__r   r   r   r"   r   r   r   r   r      s   r   c               @   s   e Zd Zdd ZdS )TestCalculationsc             C   s0   t d}|d  d9  < t|}|dks,td S )Nz        - 0.1
        r   r   z- -0.1
)r	   r
   r   )r   r   xr   r   r   test_mul_00S   s
    zTestCalculations.test_mul_00N)r#   r$   r%   r)   r   r   r   r   r&   R   s   r&   )
__future__r   r   r   r   r!   Z	roundtripr   r   r	   r
   r   objectr&   r   r   r   r   <module>   s   F