Current File : //opt/imh-python/lib/python2.7/test/test_cmath.pyc
�
��Wc@sddlmZmZddlmZmZddlZddlZddlZddlm	Z	m
Z
mZmZe
d�Ze
d�ZgddgD](ZddgD]Zeee�^q�q�Zgedfed	feefd	efdefdefd
efeefed	fedfedfed
feefd
efdefdefd	efeefed
fedfgD]\ZZeee�^q�Zgeefed
fedfedfed	feefeefd
efdefdefd	efeefgD]\ZZeee�^q"Zdejfd��YZd
�Zedkr{e�ndS(i����(trun_unittesttcpython_only(tparse_testfilet	test_fileN(tphasetpolartrecttpitinftnangg�gffffff@gffffff�t
CMathTestscBs"eZgdddddddddd	d
ddd
ddgD]Zeee�^q=Zejd��ejd��d�Zd�Zddd%d�Z
d�Zd�Zd�Z
d�Zd�Zd�Zd�Zed��Zd�Zd �Zd!�Zd"�Zd#�Zd$�ZRS(&tacostacoshtasintasinhtatantatanhtcostcoshtexptlogtlog10tsintsinhtsqrtttanttanhcCstj|d�S(Ng�@yy�@(tcmathR(tx((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyt<lambda>7scCstjd|�S(Ng,@y;@y,@;�(RR(R((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyR8scCstt�|_dS(N(topenRttest_values(tself((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pytsetUp:scCs|jj�dS(N(Rtclose(R ((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyttearDown=sgV瞯�<g
cCsGtj|�rAtj|�r"dS|j|p:dj|��ntj|�r�||kr`dS|j|p{dj||��n|r�|r�tjd|�tjd|�kr�|j|p�dj||��q�nyt||�}Wntk
rn$X|t||t|��kr$dS|j|p?dj||��dS(s�Fail if the two floating-point numbers are not almost equal.

        Determine whether floating-point values a and b are equal to within
        a (small) rounding error.  The default values for rel_err and
        abs_err are chosen to be suitable for platforms where a float is
        represented by an IEEE 754 double.  They allow an error of between
        9 and 19 ulps.
        Ns{!r} should be nans>finite result where infinity expected: expected {!r}, got {!r}g�?s,zero has wrong sign: expected {!r}, got {!r}s({!r} and {!r} are not sufficiently close(	tmathtisnantfailtformattisinftcopysigntabst
OverflowErrortmax(R tatbtrel_errtabs_errtmsgtabsolute_error((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pytrAssertAlmostEqual@s*$
c	Csld}d}|jtj|ddddjtj|��|jtj|ddddjtj|��dS(NgiW�
�@g-DT�!	@tplacesi	R1scmath.pi is {}; should be {}scmath.e is {}; should be {}(tassertAlmostEqualRRR'te(R t
e_expectedtpi_expected((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyttest_constantsrscs�d"�d�dddddt�tg}dtfd	��Y}d
d#d��Y}dtfd
��Y�dtf�fd��Y}dd$�fd��Y}dtfd��Y}dd%d��Y}dtfd��Y}dd&d��Y}	dtf��fd��Y}
dd'��fd��Y}dtf�fd��Y}d d(�fd!��Y}
x�|jD]�}|j||���|���|j||���|���|j||
��|���|j||��|���|j||��|���|j||
��|���|jt||��|jt||��|jt||��|jt||	��x@|D]8}|jt|||��|jt|||��q�W|j�||��|j�||��qjWdS()Ng��z�@y7Ă?�?g]�ֆ�snot complexilg@t	MyComplexcBseZd�Zd�ZRS(cSs
||_dS(N(tvalue(R R;((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyt__init__�scSs|jS(N(R;(R ((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyt__complex__�s(t__name__t
__module__R<R=(((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyR:�s	tMyComplexOScBseZd�Zd�ZRS(cSs
||_dS(N(R;(R R;((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyR<�scSs|jS(N(R;(R ((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyR=�s(R>R?R<R=(((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyR@�s	t
SomeExceptioncBseZRS((R>R?(((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyRA�stMyComplexExceptioncseZ�fd�ZRS(cs
��dS(N((R (RA(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyR=�s(R>R?R=((RA(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyRB�stMyComplexExceptionOScseZ�fd�ZRS(cs
��dS(N((R (RA(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyR=�s(R>R?R=((RA(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyRC�stNeitherComplexNorFloatcBseZRS((R>R?(((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyRD�stNeitherComplexNorFloatOScBseZRS((R>R?(((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyRE�stMyIntcBs#eZd�Zd�Zd�ZRS(cSsdS(Ni((R ((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyt__int__�scSsdS(Nl((R ((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyt__long__�scSsdS(Ni((R ((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyt	__index__�s(R>R?RGRHRI(((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyRF�s		tMyIntOScBs#eZd�Zd�Zd�ZRS(cSsdS(Ni((R ((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyRG�scSsdS(Nl((R ((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyRH�scSsdS(Ni((R ((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyRI�s(R>R?RGRHRI(((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyRJ�s		tFloatAndComplexcs&eZ�fd�Z�fd�ZRS(cs�S(N((R (tflt_arg(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyt	__float__�scs�S(N((R (tcx_arg(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyR=�s(R>R?RMR=((RNRL(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyRK�stFloatAndComplexOScs&eZ�fd�Z�fd�ZRS(cs�S(N((R (RL(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyRM�scs�S(N((R (RN(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyR=�s(R>R?RMR=((RNRL(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyRO�st	JustFloatcseZ�fd�ZRS(cs�S(N((R (RL(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyRM�s(R>R?RM((RL(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyRP�stJustFloatOScseZ�fd�ZRS(cs�S(N((R (RL(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyRM�s(R>R?RM((RL(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyRQ�sy��z�@7��?(((((((tNonetobjecttNotImplementedt	Exceptionttest_functionstassertEqualtassertRaisest	TypeError(R t
non_complexesR:R@RBRCRDRERFRJRKRORPRQtftbad_complex((RARNRLsh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyttest_user_objectzsB""
cCs�xM|jD]B}x9dddgD](}|j||�||j���q Wq
WxD|jD]9}x0dddddgD]}|jt||�qvWqZWdS(	Nilg@R-tlong_stringt0t1jt(RVRWRMRXRY(R R[targ((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyttest_input_type�s*cCs�ddddddg}|g|D]
}|^q"ddd	g}|dgg|D]}d|^qT}dg|}dg|g|D]
}|^q�}i
|d
6|d6|d6|d
6|d6|d6|d6|d6|d6|d6|d6|d6|d6}x�|j�D]s\}}	tt|�}
tt|�}xF|	D]>}||�}
|j|
|�|
j�|jd|
j�q<WqWxldddgD][}xR|D]J}tj||�}
|jtj||�|
j�|jd|
j�q�Wq�WdS(Ng{�G�z�?g�������?g�������?g�?g�������?g�G�z��?gg�?g�RR
RRRRRRRRRRRg@g$@(	titemstgetattrR$RR3trealRWtimagR(R RRt
unit_intervaltpositivetnonnegativet	real_lineRVtfntvaluestfloat_fnt
complex_fntvtztbase((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyttest_cmath_matches_math�s@(
%


c
Cs�tjd�jd�s(|jd�nd�}d�}xUtt�D]G\}}}}}}}	t||�}
t||�}|dkr�|}n$|dkr�|}ntt|�}d|	ks�d	|	kry||
�}
Wnt	k
r�qGqX|j
d
j||||��nd|	kroy||
�}
Wntk
rLqGqoX|j
dj||||��n||
�}
d
|	kr�tt
|
j�|
j�}
tt
|j�|j�}nd|	krt|
jt
|
j��}
t|jt
|j��}n|dkrd}nd}dj|||||j|j|
j|
j�}|j|j|
jd|d|�|j|j|
jd|�qGWdS(NtdoubletIEEEsneeds IEEE doublecSstj|j|j�S(saWrapped version of rect that accepts a complex number instead of
            two float arguments.(RRRfRg(Rq((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pytrect_complexscSstt|��S(sYWrapped version of polar that returns a complex number instead of
            two floats.(tcomplexR(Rq((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyt
polar_complex$sRRsdivide-by-zerotinvalids9ValueError not raised in test {}: {}(complex({!r}, {!r}))toverflows<OverflowError not raised in test {}: {}(complex({!r}, {!r}))signore-real-signsignore-imag-signRRgV瞯�<g
s�{}: {}(complex({!r}, {!r}))
Expected: complex({!r}, {!r})
Received: complex({!r}, {!r})
Received value insufficiently close to expected value.R0R1(slogslog10(tfloatt
__getformat__t
startswithtskipTestRRRwReRt
ValueErrorR&R'R+R*RfRgR3(R RvRxtidRltartaiterteitflagsRbtexpectedtfunctiontactualtreal_abs_errt
error_message((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyttest_specific_valuessZ		(		

	csX��fd�}|dd�|dd�|ddtf�|ddtdf�|d	d
tdf�td�}|t|d�|df�|t|d�|tf�|td|�|tdf�|td
|�|tdf�|t||�|tdf�|t||�|tdf�|t||�|dtdf�|t||�|dtdf�td�}|t|d�||f�|td|�||f�|t||�||f�|t||�||f�|t||�||f�|t||�||f�|t||�||f�dS(Ncs@�|�}x-t||�D]\}}�j||�qWdS(N(tzipR3(RbR�tgotR6tg(tfuncR (sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pytcheckcsigig�?i����y�?iy�g@Riiii����R	(gg(g�?g(RR{Rw(R R�R�RR	((R�R sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pytcheck_polarbs.

 " "%&cCs|jt�dS(N(R�R(R ((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyt
test_polar~scs0ddlm��fd�}|j|�dS(Ni����(t	set_errnocs*�d�zt|�SWd�d�XdS(Nii(R(Rq(R�(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pytpolar_with_errno_set�s
(t	_testcapiR�R�(R R�((R�sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyttest_polar_errno�scCs|jtd�d�|jtd�d�|jtd�t�|jtd�t�|jtd�t�|jtd�td�|jtd�td�|jttdd��d�|jttdd	��d	�|jttd	d��t�|jttd	d	��t�|jtttd	��t�|jtttd
��t�|jtttt��dt�|jttd
t��td�|jttd	t��td�|jttdt��td�|jttdt��td�|jtttt��td
�|jtttd
��d	�|jtttd	��d	�|jtttd��d�|jtttd��d�|jtttt��td
�|jttdt��td�|jttdt��td�|jttd	t��td�|jttd
t��td�|jtttt��dt�|jtttd��t�|jtttd��t�x*tD]"}|jtj	t|���q�WdS(Nigg�?g�yY��n�y�?iy�g�gffffff�g�gffffff@ig�?y�Y��n�y�Y��n��(
R5RRRWRwtINFtcomplex_nanst
assertTrueR$R%(R Rq((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyt
test_phase�sB !!%%%%%%#####$  
cCsTx$tD]}|jt|�d�qWx$tD]}|jt|�t�q.W|jtttt��t�|jtj	tttd����|jtj	tttd����|jtj	tttd����|jtj	tttd����|jtttt��t�|jtttt��t�|jtj	ttdt����|jtj	ttdt����|jtj	ttdt����|jtj	ttdt����|jtttt��t�|jtj	tttt����t
jd�jd�rP|j
tttdd��ndS(Nggffffff�g�gffffff@RtRug��U���(t
complex_zerosRWR*tcomplex_infinitiesR�RwtNANR�R$R%R{R|R}RXR+(R Rq((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyttest_abs�s&

 %%%% %%%%%cCsZd}t|j|d�|ks@t|j|d�|krV|j||f�ndS(NgH�����z>ii(R*RfRgR&(R R-R.teps((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pytassertCEqual�s:cCs�|jtdd�d�|jtdd�d�|jtdt�d�|jtdtd�d	�|jtdtd�d
�dS(Niig�?g�i(ii(g�?i(g�i(ig�?(ig�(R�RR(R ((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyt	test_rect�s
cCs�|jtjd��|jtjd��|jtjt��|jtjt��|jtjttd���|jtjtdt���|jtjttt���|jtjttt���|jtjttt���dS(Niy�?i(tassertFalseRR%R�R�R�Rw(R ((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyt
test_isnan�scCs�|jtjd��|jtjd��|jtjt��|jtjt��|jtjttd���|jtjtdt���|jtjttt���|jtjttt���|jtjttt���dS(Niy�?i(R�RR(R�R�R�Rw(R ((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyt
test_isinf�sN(R>R?tfnameReRRVtappendR!R#RRR3R9R]RcRsR�R�R�RR�R�R�R�R�R�R�(((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyR
0s0(		1		e		0	G			)				cCstt�dS(N(RR
(((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyt	test_main�st__main__(ttest.test_supportRRttest.test_mathRRtunittestRR$RRRRR{R�R�RtyRwR�R�R�tTestCaseR
R�R>(((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_cmath.pyt<module>s\";							









	.
					
				.��