config root man

Current Path : /compat/linux/proc/self/root/usr/local/lib/python2.5/test/

FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64
Upload File :
Current File : //compat/linux/proc/self/root/usr/local/lib/python2.5/test/test_decimal.pyc

hRc@sdZddklZddkZddkZddkZddkZddkZddkZddk	Tddk
lZlZl
Z
lZddkZyddkZWnej
o
eZnXeiiZdZdZedjoeid	ZneZeiiepeiZ e ei!eei!Z"eii#e"a$e%Z&he'd
<e(d<e)d<e(d
<e(d<e*d<e(d<e(d<e+d<e,d<e-d<e.d<Z/dZ0he1d<e2d<e3d<e4d<e5d<e6d<e7d<e8d<Z9hdd <d!d"<d#d$<d%d&<d'd(<d)d*<d+d,<d-d.<d/d0<d1d2<d3d4<d5d6<d7d8<d9d:<d;d<<d=d><d?d@<dAdB<dCdD<dEdF<dGdH<dIdJ<dKdL<dMdN<dOdP<dQdR<dSdT<dUdV<dWdX<dYdZ<d[d\<d]d^<d_d`<dadb<dcdd<dedf<dgdh<Z:d7d9d;d=d?dAdCdEdGdId[fZ;didjdkdlfZ<dmZ=dnZ>doei?fdpYZ@dqei?fdrYZAdsei?fdtYZBduei?fdvYZCdwZDdxZEdyei?fdzYZFd{ei?fd|YZGd}ei?fd~YZHdei?fdYZIdei?fdYZJdei?fdYZKe%eeedZLedjoddkMZMeMiNdZOeOiPddddddeOiPddddddeOiQ\ZRZSeRiToeLde%deUnAeSo&eLdeUdeUdeSdeRiVneLdeUdeUndS(se
These are the test cases for the Decimal module.

There are two groups of tests, Arithmetic and Behaviour. The former test
the Decimal arithmetic using the tests provided by Mike Cowlishaw. The latter
test the pythonic behaviour according to PEP 327.

Cowlishaw's tests can be downloaded from:

   www2.hursley.ibm.com/decimal/dectest.zip

This test module can be called from command line with one parameter (Arithmetic
or Behaviour) to test each part, or without parameter to test both parts. If
you're working through IDLE, you can import this test module and call test_main()
with the corresponding argument.
i(twith_statementN(t*(tTestSkippedtrun_unittesttrun_doctesttis_resource_enabledcCsDtiadt_tt_tit	dt_
ttdS(Ni	i(t
getcontexttcopytORIGINAL_CONTEXTtDefaultContexttprectROUND_HALF_EVENtroundingtdicttfromkeystSignalsttrapst
setcontext(((s-/usr/local/lib/python2.5/test/test_decimal.pytinit.s
		tdecimaltestdatat__main__itclampedtconversion_syntaxtdivision_by_zerotdivision_impossibletdivision_undefinedtinexacttinvalid_contexttinvalid_operationtoverflowtroundedt	subnormalt	underflowcGsdS(sDoesn't do anything.N(tNone(targs((s-/usr/local/lib/python2.5/test/test_decimal.pytNonfunctionSstceilingtdowntfloort	half_downt	half_eventhalf_uptupt05uptlogical_andtandt_applytapplytnumber_classtclasstcompare_signalt
comparesigt
compare_totaltcomparetotaltcompare_total_magt
comparetotmagtcopy_decimalRtcopy_abstcopyabstcopy_negatet
copynegatet	copy_signtcopysignt
divide_intt	divideinttlogical_inverttinverttis_canonicaltiscanonicalt	is_finitetisfinitetis_infinitet
isinfinitetis_nantisnant	is_normaltisnormaltis_qnantisqnant	is_signedtissignedtis_snantissnantis_subnormaltissubnormaltis_zerotiszerotmax_magtmaxmagtmin_magtminmagt
next_minust	nextminust	next_plustnextplustnext_towardt
nexttowardt
logical_ortort	normalizetreducetremainder_neart
remainderneartsame_quantumtsamequantumtsqrtt
squareroott
to_eng_stringttoengtto_integral_valuet
tointegraltto_integral_exactttointegralxt
to_sci_stringttoscitlogical_xortxortpowertlntlog10texpi?BcCs|itjp!|itjp|itjotSn|ioS|oLt|itjp.|itjp|iddtjotSnt	S(Nii(
R
tDEC_MAX_MATHtEmaxtEmintTruet_is_specialtlent_inttadjustedtFalse(tvtcontext((s-/usr/local/lib/python2.5/test/test_decimal.pytoutside_decNumber_boundsstDecimalTestcBszeZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZRS(
s[Class which tests the Decimal class against the test cases.

    Changed for unittest.
    cCst|_x$tiiD]}dti|<qWdg|_h|id<|id<|id<|i	d<|i
d<|_dS(Nit#t	precisionRtmaxexponenttminexponenttclamp(tContextRR	Rtkeystignore_listtchange_precisiontchange_rounding_methodtchange_max_exponenttchange_min_exponenttchange_clampt
ChangeDict(tselftkey((s-/usr/local/lib/python2.5/test/test_decimal.pytsetUpscCs+x$tiiD]}dti|<qWdS(sCleaning up enviroment.iN(R	RR(RR((s-/usr/local/lib/python2.5/test/test_decimal.pyttearDownscCstotdSnxt|iD]n}|iddidd}y|i|}Wq(tj
o(}|id|ii	d|q(Xq(WdS(Ns
ts
sException "s" raised on line (
t
skip_expectedRtopent
xreadlinestreplacet	eval_linetDecimalExceptiontfailt	__class__t__name__(Rtfiletlinettt	exception((s-/usr/local/lib/python2.5/test/test_decimal.pyt	eval_files(cCs|iddjoa|d djoP|ido?|iddd|iddiddi}n|iddi}x/|iD]$}|i|djodSqqW|pdSn,d|jo|i|Sn|i|SdS(	Ns -> iis--s  --s->it:(tfindt
startswithtsplittstripRteval_directivet
eval_equation(Rtstignore((s-/usr/local/lib/python2.5/test/test_decimal.pyRs8+

cCstd|id\}}|djot|}n'yt|}Wntj
onX|ii|t}||dS(NcSs|iiS((Rtlower(tx((s-/usr/local/lib/python2.5/test/test_decimal.pyt<lambda>sRR(tmapRtRoundingDicttintt
ValueErrorRtgetR#(RRtfuncttvalue((s-/usr/local/lib/python2.5/test/test_decimal.pyRs!
cCs{totidjodSny|id}|dii}|d}todG|Gn|di}|d}|dii}|d}|d}Wn"tttfj
o
t	nXd}	t
i||}
|
djodSnt|i
|
}g}d	}d}
g}|D]}|t|iq1~}xtD]}d|i
i|<qXWx|D]}d|i
i|<qyWxmt|D]_\}}|id
ddjod|
}
n|
o|d|}qn||}d	}|	|}|
djotox|D]}d|i
i|<y||i
i|WnA|j
onGtj
o#}|id|||fnX|id||fd|i
i|<q'Wn|i
i|}nt||i
}|i|qW|	|}|
tjo|
djoq|diod|djo
djnp:t|d|i
pt|d|i
odSqqqt|d|i
odSqnto|
djox|D]}d|i
i|<y||WnA|j
onGtj
o#}|id|||fnX|id||fd|i
i|<qWntodG|i
GHny?t||}|
tjottt|}nWn>tj
o }|id||fndG|GHnX|i}|i
i |i!|i!|i"||d|d||i"||d|dt|dS(Ng?s->isTest iicSs^|iddidd}|iddidd}|iddidd}|S(Ns''tSingleQuotes""tDoubleQuotet'Rt"(R(tval((s-/usr/local/lib/python2.5/test/test_decimal.pyt	FixQuotesstrescaleRRt RqRks Raised %s in %s when %s disabledsDid not raise %s in %sRuilʈiɚ;s--sRaised %s in %ssERROR:sIncorrect answer for s -- got sIncorrect flags set in (Rqs
to_eng_string(Rqs
to_eng_string(#tTEST_ALLtrandomRRtDEBUGRt	TypeErrortAttributeErrort
IndexErrortInvalidOperationtnameAdapterRtgetattrRt
ErrorNamesRRt	enumeratetcounttEXTENDEDERRORTESTtcreate_decimalRtDecimaltappendtdecNumberRestrictedt
_isintegerRtstrtLOGICAL_FUNCTIONSRtevalt
getexceptionstclear_flagstsorttassertEqual(RRtSidestLtidRtvalstemptanst
exceptionsRtfnametvalstconglomeratetquotet_[1]RttheirexceptionsRtiRRterrortetresulttmyexceptions((s-/usr/local/lib/python2.5/test/test_decimal.pyRs


	
+


	

"	
 	


cCs4g}tD]"}|ii|o||qq~S(N(RRtflags(RRR((s-/usr/local/lib/python2.5/test/test_decimal.pyRrscCs||i_dS(N(RR
(RR
((s-/usr/local/lib/python2.5/test/test_decimal.pyRuscCs||i_dS(N(RR(RR((s-/usr/local/lib/python2.5/test/test_decimal.pyRwscCs||i_dS(N(RR{(RRx((s-/usr/local/lib/python2.5/test/test_decimal.pyRyscCs||i_dS(N(RRz(RRx((s-/usr/local/lib/python2.5/test/test_decimal.pyR{scCs||i_dS(N(Rt_clamp(RR((s-/usr/local/lib/python2.5/test/test_decimal.pyR}s(Rt
__module__t__doc__RRRRRRRRRRRR(((s-/usr/local/lib/python2.5/test/test_decimal.pyRs					
	z					tDecimalExplicitConstructionTestcBsMeZdZdZdZdZdZdZdZdZ	RS(s6Unit tests for Explicit Construction cases of Decimal.cCs|ittddS(Nt0(RR(R((s-/usr/local/lib/python2.5/test/test_decimal.pyttest_explicit_emptyscCs|ittddS(N(tassertRaisesRRR!(R((s-/usr/local/lib/python2.5/test/test_decimal.pyttest_explicit_from_NonescCstd}|it|dtd}|it|dtd}|it|dtd}|it|ddS(	Ni-t45i{et	500000123is-45iR(RRR(Rtd((s-/usr/local/lib/python2.5/test/test_decimal.pyttest_explicit_from_intscCs|ittdd|ittdd|ittdd|ittdd|ittdd|ittdd	|ittd
d|ittdd|ittd
ddS(NRtNaNRs45.34t45e2s4.5E+3tuglyu0E-017s0E-17u45u-Infs	-InfinityuNaN123tNaN123(RRR(R((s-/usr/local/lib/python2.5/test/test_decimal.pyttest_explicit_from_stringscCstdddf}|it|dtdddf}|it|dtdddf}|it|d	tdddf}|it|d|ittddf|ittd
ddf|ittdddf|itttdddf|ittdddf|ittdddf|ittdddf|ittdd df|ittdd!df|ittdd"df|ittdd#dfdS($NiRiiis-45iis45.34i	is-4.34913534E-17iigswrong!t1ii
ta(i(ii(iiii(	iiii	iiiii(iiii	i(iiii	i(iiii	i(iiii	i(iiii	i(iiii	i(iiii	i(iiiNi(iiii	i(ii
ii	i(iiiRi(RRRRRR!(RR((s-/usr/local/lib/python2.5/test/test_decimal.pyttest_explicit_from_tupless&"cCs,td}t|}|it|d|it|t|td}t|}|it|d|it|t|td}t|}|it|d|it|t|td}t|}|it|d|it|t|dS(	Ni-Ri{eRis-45iR(RRRtassertNotEqualR(RRR((s-/usr/local/lib/python2.5/test/test_decimal.pyttest_explicit_from_Decimals cCstit}d|_t}|it|d|i}|it|d|it|id|id}|i
t|t|i|id|idtd}|it|d|id}|it|dtdddf}|it|d
|idddf}|it|dtd}t|}|it|d|i|}|it|ddS(NiRiins457E+2t456789s4.57E+5iii	iis-4.34913534E-17s	-4.35E-17i{eRs5.00E+8(	iiii	iiiii(	iiii	iiiii(RRR
RRRRRRR!t
failUnlesst
isinstance(RtncRtprevdec((s-/usr/local/lib/python2.5/test/test_decimal.pyt$test_explicit_context_create_decimals0		(
RRRRRRRRRR(((s-/usr/local/lib/python2.5/test/test_decimal.pyRs					%	tDecimalImplicitConstructionTestcBsDeZdZdZdZdZdZdZdZRS(s6Unit tests for Implicit Construction cases of Decimal.cCs|ittdtdS(NsDecimal(5) + None(RRRtglobals(R((s-/usr/local/lib/python2.5/test/test_decimal.pyttest_implicit_from_None scCsD|ittddd|itddtddS(Nii-t50I(RRR(R((s-/usr/local/lib/python2.5/test/test_decimal.pyttest_implicit_from_int#s cCs|ittdtdS(NsDecimal(5) + "3"(RRRR
(R((s-/usr/local/lib/python2.5/test/test_decimal.pyttest_implicit_from_string)scCs|ittdtdS(NsDecimal(5) + 2.2(RRRR
(R((s-/usr/local/lib/python2.5/test/test_decimal.pyttest_implicit_from_float,scCs*|itdtdtddS(Nii-i2(RR(R((s-/usr/local/lib/python2.5/test/test_decimal.pyttest_implicit_from_Decimal/scsdd2dY}|it|tdd|ittd|d|itdd|itdd	|itd
d|itdd
|itdd|itddd3d4d5d6d7d8g}d$d%d&jo|id9n|id:x|D]\}t|fd,t|fd-|itd.|d/d0d1|itd/|d.d1d0q)WdS(;NtEcBsPeZdZdZdZdZdZdZdZdZ	RS(cSsdt|S(Nsdivmod (R(Rtother((s-/usr/local/lib/python2.5/test/test_decimal.pyt
__divmod__5scSst|dS(Ns rdivmod(R(RR((s-/usr/local/lib/python2.5/test/test_decimal.pyt__rdivmod__7scSsdt|S(Nslt (R(RR((s-/usr/local/lib/python2.5/test/test_decimal.pyt__lt__9scSsdt|S(Nsgt (R(RR((s-/usr/local/lib/python2.5/test/test_decimal.pyt__gt__;scSsdt|S(Nsle (R(RR((s-/usr/local/lib/python2.5/test/test_decimal.pyt__le__=scSsdt|S(Nsge (R(RR((s-/usr/local/lib/python2.5/test/test_decimal.pyt__ge__?scSsdt|S(Nseq (R(RR((s-/usr/local/lib/python2.5/test/test_decimal.pyt__eq__AscSsdt|S(Nsne (R(RR((s-/usr/local/lib/python2.5/test/test_decimal.pyt__ne__Cs(
RRRRRRRRRR(((s-/usr/local/lib/python2.5/test/test_decimal.pyR4s							i
s	divmod 10s
10 rdivmodsDecimal(10) < E()sgt 10sDecimal(10) > E()slt 10sDecimal(10) <= E()sge 10sDecimal(10) >= E()sle 10sDecimal(10) == E()seq 10sDecimal(10) != E()sne 10t+t__add__t__radd__t-t__sub__t__rsub__Rt__mul__t__rmul__t%t__mod__t__rmod__s//t__floordiv__t
__rfloordiv__s**t__pow__t__rpow__iiit/t__div__t__rdiv__t__truediv__t__rtruediv__csdt|S(R(R(RR(tlop(s-/usr/local/lib/python2.5/test/test_decimal.pyR`scst|dS(R(R(RR(trop(s-/usr/local/lib/python2.5/test/test_decimal.pyRassE()sDecimal(10)Rt10((Rs__add__s__radd__(Rs__sub__s__rsub__(Rs__mul__s__rmul__(R#s__mod__s__rmod__(s//s__floordiv__s
__rfloordiv__(s**s__pow__s__rpow__(R*s__div__s__rdiv__(R*s__truediv__s__rtruediv__(RtdivmodRRRtsetattr(RRtoplisttsym((R/R0s-/usr/local/lib/python2.5/test/test_decimal.pyttest_rop2s4""	
(	RRRRR
RRRR6(((s-/usr/local/lib/python2.5/test/test_decimal.pyR	s					tDecimalArithmeticOperatorsTestcBs_eZdZdZdZdZdZdZdZdZ	dZ
d	ZRS(
s:Unit tests for all arithmetic operators, binary and unary.cCstd}td}|i||td|i||td|d}|i|td|it|t|d|}|i|td|it|t|||7}|i|td|d7}|i|tddS(Ns-11.1s22.2s11.1is-6.1s16.1(RRttype(Rtd1td2tc((s-/usr/local/lib/python2.5/test/test_decimal.pyt
test_additionjs



cCstd}td}|i||td|i||td|d}|i|td|it|t|d|}|i|td|it|t|||8}|i|td|d8}|i|tddS(	Ns-11.1s22.2s-33.3s33.3is-16.1s16.1s-38.3(RRR8(RR9R:R;((s-/usr/local/lib/python2.5/test/test_decimal.pyttest_subtractions



cCstd}td}|i||td|i||td|d}|i|td|it|t|d|}|i|td|it|t|||9}|i|td|d9}|i|tddS(Ns-5t3s-15is-25s-75(RRR8(RR9R:R;((s-/usr/local/lib/python2.5/test/test_decimal.pyttest_multiplications



cCstd}td}|i||td|i||td|d}|i|td|it|t|d|}|i|td|it|t|||:}|i|td|d:}|i|tddS(	Ns-5t2s-2.5s-0.4is-1.25s-0.8s-0.625(RRR8(RR9R:R;((s-/usr/local/lib/python2.5/test/test_decimal.pyt
test_divisions



cCstd}td}|i||td|i||td|d}|i|td|it|t|d|}|i|td|it|t|||}|i|td|d}|i|tddS(Nt5R@RiRii(RRR8(RR9R:R;((s-/usr/local/lib/python2.5/test/test_decimal.pyttest_floor_divisions



cCstd}td}|i||td|i||td|d}|i|td|it|t|d|}|i|td|it|t|||C}|i|td|dC}|i|td	dS(
NRBR@t25t32it625it16807t390625(RRR8(RR9R:R;((s-/usr/local/lib/python2.5/test/test_decimal.pyt
test_powerings



cCstd}td}|i||td|i||td|d}|i|td|it|t|d|}|i|td|it|t|||;}|i|td|d;}|i|tddS(NRBR@Rii(RRR8(RR9R:R;((s-/usr/local/lib/python2.5/test/test_decimal.pyttest_modules



cCstd}td}t||\}}|i|td|i|td|it|t||it|t|t|d\}}|i|td|i|td|it|t||it|t|td|\}}|i|td|i|td|it|t||it|t|dS(NRBR@Rii(RR2RR8(RR9R:tptq((s-/usr/local/lib/python2.5/test/test_decimal.pyttest_floor_div_module's"cCsg|itd
td
|itdtd|ittdttddS(Ni-i(RRtabs(R((s-/usr/local/lib/python2.5/test/test_decimal.pyttest_unary_operatorsAs(RRRR<R=R?RARCRIRJRMRO(((s-/usr/local/lib/python2.5/test/test_decimal.pyR7gs								cCsjtd}td}|i||td|ii|i||td|iidS(Niis0.333333333(RRtsynchrotwaittfinish1tset(tclsR9td3((s-/usr/local/lib/python2.5/test/test_decimal.pytthfunc1Is

cCs|td}td}|i||tdt}d|_|i||td|ii|iidS(Niis0.333333333is0.333333333333333333(RRRR
RPRStfinish2(RTR9RUtthiscontext((s-/usr/local/lib/python2.5/test/test_decimal.pytthfunc2Rs		

tDecimalUseOfContextTestcBsWeZdZyddkZWnej
o
dZnXdZedjo[nRS(s/Unit tests for Use of Context cases in Decimal.iNcCsti|_ti|_ti|_tidtd|f}tidtd|f}|i|i|ii	|ii	dS(NttargetR"(
t	threadingtEventRPRRRWtThreadRVRYtstartRQ(Rtth1tth2((s-/usr/local/lib/python2.5/test/test_decimal.pyttest_threadingis



(RRRR\tImportErrorR!Rb(((s-/usr/local/lib/python2.5/test/test_decimal.pyRZ^s	
tDecimalUsabilityTestcBszeZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZRS(
s*Unit tests for Usability cases of Decimal.cCsGtd}td}td}|i||j|i||j|i||j|i||j|i||j|i||j|i||j|i||j|it||d|it||d|it||d|i|dj|id|j|i|dj|it|dd|itd|d|it|dd|i|d|i|d	|i|t|i|ttttd
}|}ti	||i
|i|||itddj|i
tddjdS(Ns23.42Riiiii-RgY@@id(RRRtcmpRtobjectRtxrangeRtshuffleRtassertFalseR!t
assertTrue(RtdatdbtdcRtb((s-/usr/local/lib/python2.5/test/test_decimal.pyttest_comparison_operatorss>

cCsftd}ti|}|it|t|ti|}|it|t|dS(Ns43.24(RRRRtdeepcopy(RRR;Rm((s-/usr/local/lib/python2.5/test/test_decimal.pyttest_copy_and_deepcopy_methodss
c
Cs\ttdg}dddddddd	d
ddd
ddgD]H}tddD]2}ddgD]}|t|d||qhqXqE~}|itdtdtdtdtdtdtdtdtdtd(d)dtdtdtd td!td"gx0|D](}|it|tt|q9W|ittdtd|itttd#|ittd$|ittd%t	}|i
}td&}	d'|_
t|	}
d|_
t|	}d|_
t|	}|i|
||i|
|||_
dS(*Niiiiiiiii i!i>i?i@iAiBii
iiis-0s0.00s-0.000t0E10s-0E12s10.0s	-23.00000t1230E100s
-4.5678E50s	1.634E100s
90.697E100s
188.83E100s
1652.9E100t	56531E100RtInfs-Infs123456789.1ilI(thashRtrangetextendRRRRtassert_RR
(
RRtmtntsignttest_valuesRR;t
old_precisionRth1th2th3((s-/usr/local/lib/python2.5/test/test_decimal.pyttest_hash_methodsR8													&"					cCstd}td}d}d}|it|||j|it|||j|it|||j|it|||j|it|||j|it|||j|it|||j|it|||jdS(Ns15.32s28.5ii(RRtmintmax(RR9R:tl1tl2((s-/usr/local/lib/python2.5/test/test_decimal.pyttest_min_and_max_methodsscCs*|itd|itddS(Nis0.372(tfailIfRR(R((s-/usr/local/lib/python2.5/test/test_decimal.pyttest_as_nonzeroscCstd}|it|d|it|dddddddd	g}xn|D]f}t|}|itt|t|itt|t|it|itqZWdS(
Ns15.32sDecimal("15.32")u123.4u0.5E2uInfinityusNaNu-0.0E100u-NaN001u-Inf(RRRtreprR8Rk(RRtunicode_inputstu((s-/usr/local/lib/python2.5/test/test_decimal.pyttest_tostring_methods
scCstd}td}|it|d|it|d|it|d|it|d|it|d|it|ddS(Nt66s15.32iBigp=
ף.@(RRRtlongtfloat(RR9R:((s-/usr/local/lib/python2.5/test/test_decimal.pyttest_tonum_methodsscCstdd	df}|i|tt|tdd
df}|i|tt|tdddf}|i|tt|tdddf}|i|tt|dS(
Niiiiiii	i(i(ii(iiii(	iiii	iiiii(RRRR(RR((s-/usr/local/lib/python2.5/test/test_decimal.pyttest_eval_round_trip-scCsPtd}|i|idddftd}|i|idddftd}|i|iddd	ftd
}|i|idddftdddf}|i|idddftddd
f}|i|iddd
ftddd
f}|i|iddd
ftdddf}|i|idddftdddf}|i|idddftdd df}|i|idd!dftdd"df}|i|idd#dftdd$df}|i|idd%dfdS(&Niiiiis-4.34913534E-17ii	itInfinitytFii%R{tNii(i(ii(	iiii	iiiii(i(iiiiiii(iiiii(iii(i((i(iiiiiii(iiiii(iii((((iiii(i(iiii(i(RRtas_tuple(RR((s-/usr/local/lib/python2.5/test/test_decimal.pyt
test_as_tuple?s0csvtdtdtdtdtfd}tiiiiiiiii|d|dt|dt|dt|dt|d	|d
t|d|d|d
|dt|dt|d|d|d|dt|dt|dt|dt|d|dt|dt|dt|dt|dt|d|dt|dt|d |d!|d"t|d#t|d$t|d%|d&t|d't|d(t|d)|d*|d+dS(,Ns-25e55s33e+33cs|otd|diiiiiiiiiiiiiiiiiinUtd|diiiiiiiiidS(Nsd1.s(d2)s()(RRt_signRt_exp(t	operationtuseOther(tb2Rtb1R:R9(s-/usr/local/lib/python2.5/test/test_decimal.pytcheckSameDecost__abs__RR+Rt__cmp__t	__float__R&t__hash__t__int__t__long__R$R!t__neg__t__nonzero__t__pos__R(RR,Rt__repr__R'R%R"R)R t__str__RR-RRtcompareRRRctquantizeReRgRiRktto_integral(RRRRRRR|(RR((RRRR:R9s-/usr/local/lib/python2.5/test/test_decimal.pyttest_immutability_operationsgsb







































cCs}dtfdY}|d}|d}||}|it|tj|i|}|it|tjdS(Nt	MyDecimalcBseZRS((RR(((s-/usr/local/lib/python2.5/test/test_decimal.pyRsii(RRjR8R(RRR9R:R((s-/usr/local/lib/python2.5/test/test_decimal.pyttest_subclassings
cCsDt}|ittdit|itddS(Ni(RRRRRi(RR;((s-/usr/local/lib/python2.5/test/test_decimal.pyttest_implicit_contexts	(RRRRoRqRRRRRRRRRR(((s-/usr/local/lib/python2.5/test/test_decimal.pyRd~s	,		=						(	F	tDecimalPythonAPItestscBseZdZdZRS(cCs>td}ti|}ti|}|i||dS(Ns-3.141590000(RtpickletdumpstloadsR(RRRKR((s-/usr/local/lib/python2.5/test/test_decimal.pyttest_picklescCsxtddD]s}d|d}|itt|tt|t|}|it}|itt||qWdS(Niis%0.2fgY@(RwRRRRRt
ROUND_DOWN(RRRRtr((s-/usr/local/lib/python2.5/test/test_decimal.pyttest_ints((RRRR(((s-/usr/local/lib/python2.5/test/test_decimal.pyRs	tContextAPItestscBs#eZdZdZdZRS(cCslt}titi|}xDt|D]6}t||}t||}|i||q.WdS(N(RRRRtvarsR(RR;Rtktv1tv2((s-/usr/local/lib/python2.5/test/test_decimal.pyRs	
cCsW|itdddtddhgj|itddddhgjdS(Ni
Rg?ii(ii(ii(RyR(R((s-/usr/local/lib/python2.5/test/test_decimal.pyttest_equality_with_other_typess.cCsyt}|i}|it|t||it|it|i|it|it|idS(N(RRRRRR(RR;R((s-/usr/local/lib/python2.5/test/test_decimal.pyt	test_copys
	"(RRRRR(((s-/usr/local/lib/python2.5/test/test_decimal.pyRs		tWithStatementTestcBseZdZdZRS(cCst}ti}i}z|~}t}Wd|~QXt}|i||jd|i||j	d|i||jddS(Ns!did not restore context correctlysdid not copy the contexts __enter__ returned wrong context(Rtlocalcontextt__exit__t	__enter__Ry(Rtorig_ctxRt_[2]t	enter_ctxtset_ctxt	final_ctx((s-/usr/local/lib/python2.5/test/test_decimal.pyttest_localcontexts	"	cCst}tdd}t|i}i}z|~}t}Wd|~QXt}|i||jd|i|i|ijd|i||j	d|i||jddS(NR
i*s!did not restore context correctlysdid not set correct contextsdid not copy the contexts __enter__ returned wrong context(RRRRRRyR
(RRtnew_ctxRRRRR((s-/usr/local/lib/python2.5/test/test_decimal.pyttest_localcontextargs	%	(RRRR(((s-/usr/local/lib/python2.5/test/test_decimal.pyRs	
tContextFlagscBseZdZRS(cCsjtdddddddtdgd	g}|itd
gf|itdgf|itdtd
gf|itdtd
gf|itdtd
gfg}tgt	gt
gtgtgtt	t
ttgg}xv|D]n\}}|i
||}g}|iiD]\}}	|	o||q*q*~}
x|D]}|i
x|D]}|i|qoW||}
t|
}x,|D]$}||jo|i|qqW|ig}|iiD]\}}	|	o||qq~}|i|i||
dd||
f|i||dd||fqXWqWdS(NR
i	R{i6eRziɚ;RRRs100E-1000000009is
1.23456789s
9.87654321s=operation produces different answers depending on flags set: sexpected %s, got %s.s9operation raises different flags depending on flags set: sexpected %s, got %s(RRR.RRitaddtmultiplytsubtracttInexacttRoundedt	UnderflowtClampedt	SubnormalRRtitemst_raise_errortlistRRR(RRt
operationstflagsetstfnR"RRRRRtextra_flagstflagtnew_anstexpected_flagsRt	new_flags((s-/usr/local/lib/python2.5/test/test_decimal.pyttest_flags_irrelevantsF$
;


;
(RRR(((s-/usr/local/lib/python2.5/test/test_decimal.pyRsc

CsHt|p
tda|a|djo(ttttt	t
ttt
tg
}n
tg}xtitD]}d|jp|idoqnn|id\}}|dj	o||joqnn|d}ttd||~~~~qnWz8t||djoddk}	t|	|nWdttXdS(s Execute the tests.

    Runs all arithmetic tests if arith is True or if the "decimal" resource
    is enabled in regrtest.py
    tdecimals.decTestt.cSs|it|S((Rt	directory(Rtf((s-/usr/local/lib/python2.5/test/test_decimal.pyR]sttest_iN(RRRRR!RR	R7RZRdRRRRRtostlistdirRRRR3RRRRR(
tarithtverboset
todo_teststdebugttest_classestfilenametheadttailttestert
DecimalModule((s-/usr/local/lib/python2.5/test/test_decimal.pyt	test_main8s>

	

s:test_decimal.py [--debug] [{--skip | test1 [test2 [...]]}]s--debugs-dtactiont
store_truethelps2shows the test number and context before each tests--skips-ss%skip over 90% of the arithmetic testsRRRR(WRt
__future__RtunittesttglobRtsysRRRttest.test_supportRRRRRR\RcR!RRRRRtTESTDATADIRRtargvRt__file__tpathtdirnametcurdirttestdirtsepRtisdirRRRRRtDivisionByZeroRtOverflowRRRRR#t
ROUND_CEILINGRtROUND_FLOORtROUND_HALF_DOWNRt
ROUND_HALF_UPtROUND_UPt
ROUND_05UPRRRRRyRtTestCaseRRR	R7RVRYRZRdRRRRRtoptparsetOptionParserRKt
add_optiont
parse_argstoptR"tskipR|R(((s-/usr/local/lib/python2.5/test/test_decimal.pys<module>s
"	

											
						
																																					J			 E42

&

Man Man