{G_Tc@sddlZddlZddlZddlZddlmZddlmZmZm Z ddlm Z ddl Z ddl Z ddl Z ddlmZmZddlZddlZddlZddlZddlmZmZmZddlmZmZmZddlmZmZdd lmZmZdd lmZm Z ed d Z!d Z"dej#fdYZ$dej#fdYZ%de%fdYZ&defdYZ'de%fdYZ(dej#fdYZ)dej#fdYZ*de j+fdYZ,de fdYZ-d e j+fd!YZ.ddlZe/d"Z0e1d#kre0d$e2ndS(%iN(t test_support(t namedtupletCountert OrderedDict(t mapping_tests(t randrangetshuffle(tHashabletIterabletIterator(tSizedt ContainertCallable(tSett MutableSet(tMappingtMutableMapping(tSequencetMutableSequencetTestNTsx y zsccopy_reg _reconstructor p0 (ctest.test_collections TestNT p1 c__builtin__ tuple p2 (I10 I20 I30 tp3 tp4 Rp5 ccollections OrderedDict p6 ((lp7 (lp8 S'x' p9 aI10 aa(lp10 S'y' p11 aI20 aa(lp12 S'z' p13 aI30 aatp14 Rp15 b. tTestNamedTuplecBseZdZejejjdkddZdZ dZ dZ dZ dZ d Zd Zd ZRS( cCstdd}|j|jd|j|jd|j|jt|j|jtj|j|jd|jt tdd|jt tdd|jt tdd|jt td d |jt td d |jt td d |jt td d |jt td dtddtddtdd}|j dt |jtdd}|j dt |j|jt |j dg|jt |j dddgdS(NtPointsx ytxtysabc%sefg ghitclasst9abctabcsefg g%his abc classs 8efg 9ghis_efg ghis efg efg ghitPoint0sx1 y2t_sa b ctntuthe quick brown foxsu'utheuquicki ii!((RR(utheuquick(Rt assertEqualt__name__t __slots__t __module__t __getitem__ttuplet_fieldst assertRaisest ValueErrort assertNotIntreprt TypeErrort_make(tselfRR((s1/usr/local/lib/python2.7/test/test_collections.pyt test_factory<s,  is)Docstrings are omitted with -O2 and abovecCs&tdd}|j|jddS(NRsx ys Point(x, y)(RRt__doc__(R+R((s1/usr/local/lib/python2.7/test/test_collections.pyttest_factory_doc_attrYsc CssxlddgddgddgddgddgddggD].\}}|jtd|dtj|q=WdS(Ntefgsg%hit_1RRt8efgt9ghit_0t_efgtghit_2tRtNTtrename(R/sg%hi(R/R0(sabcsclass(sabcR0(R1R2(R3R0(sabcR4(sabcR0(sabcR/R/R5(sabcR/R6R5(sabcR7R(sabcR0R(RRtTrueR$(R+tspectrenamed((s1/usr/local/lib/python2.7/test/test_collections.pyttest_name_fixer_s     cCstdd}|dd}|j||dddd|j||ddd|j||dddd|j||d|j||tdddd|jt|d|jt|ddd |jttd t|jttd t|jt|d |jd t ||j||j ddg|j|j d|j|j ddd|j|j tdddd|jt||j y|j ddddWntk rnX|jdtdd}|dddd}|jt|d tdd}|dddd}|jt|d dS(NRsx yi iRRiiisPoint(XXX=1, y=2)s Point(x=1)sPoint(x=11, y=22)t __weakref__terrors%Did not detect an incorrect fieldnamesx, y(i i(RR(ii(RR(RRtdictR%R)tevaltlocalsR(R'tdirR*R$t_replacet_asdicttvarsR&t_fail(R+Rtp((s1/usr/local/lib/python2.7/test/test_collections.pyt test_instancejs:%%  cCs5tdd}|dd}|j|t|j|d |jt|d |jt|ddg|jt|d|jt|d|\}}|j|||f|j|d|dfd |jt|jd|j|j ||j|j ||jt t dt dS( NRsx yi iiiisp.z(i i(i i(i i(RtassertIsInstanceR#RtlisttmaxR%t IndexErrorR"RRtAttributeErrorRARB(R+RRHRR((s1/usr/local/lib/python2.7/test/test_collections.pyttest_tuplenesss c s tdd}|j|d|j|jgd|jt|d|j|ji|j|jdtdd}|j|dd|j|jdgd|j|djd|jt|dd|j|djidd6|j|djddd|j|djdd }d dld dl t t fd t |D}t |}td |}|t |}|j|tt ||j|jt |tt |x3t|D]%\}}|jt|||q!Wt||j} tt|t |} |j| | |jt|ddf|d dfg} t |} d| dstBigii*((((i(i(i(RR(RRR*R(RER$RRRDR[RZRKtsetRTtlenR#t enumeratetgetattrR@tzip( R+RPRQtntnamesR\tbtpostnameRRt d_expectedtb2t b2_expected((RZR[s1/usr/local/lib/python2.7/test/test_collections.pyttest_odd_sizessF#" +  /   cCstdddddd}x~ttfD]p}t|d}t|d}xId D]A}||||}|j|||j|j|jqSWq(WdS(NRi Ritzitloadstdumpsiiii(iiii(RtpickletcPickleR`RR$(R+RHtmoduleRlRmtprotocoltq((s1/usr/local/lib/python2.7/test/test_collections.pyt test_pickles cCsntdddddd}xLtjtjfD]8}||}|j|||j|j|jq.WdS(NRi RiRki(RtcopytdeepcopyRR$(R+RHtcopierRr((s1/usr/local/lib/python2.7/test/test_collections.pyt test_copys  c Cstdd}|ddddd}|j|d|jdd d d d d dddd}|j|dtj}tdddt}WdQXttjd|j }|tt j 8}td|}t t t|}||}|j|||tt|j|}|j|||j|}|j||t||j|jtt|j||j|}t d|D}|jtt|j|}|j|||j|jt ||j|j|dS(NtTs"itemgetter property self cls tupleiiiiit itemgetteri tpropertyiR+itclsi(R#i2Rtverboses [A-Za-z]+css|]}|dVqdS(i N((RWtv((s1/usr/local/lib/python2.7/test/test_collections.pys s(iiiii(i iii(i2(RRRDRtcaptured_stdoutR:R]tretfindalltgetvaluetkeywordtkwlistR#RTR^R@RaR$R*R(REt__getnewargs__(R+Rxtttnewtttemplatetwordstvaluest newvalues((s1/usr/local/lib/python2.7/test/test_collections.pyttest_name_conflictss2*  (!cCs&tjt}|j|jddS(Ni (RnRltpy273_named_tuple_pickleRR(R+tpt((s1/usr/local/lib/python2.7/test/test_collections.pyttest_pickling_bug_18015s(RR!R,tunittesttskipIftsystflagstoptimizeR.R=RIRORjRsRwRR(((s1/usr/local/lib/python2.7/test/test_collections.pyR:s  %  '  &t ABCTestCasecBs#eZdZdZdZRS(cGstj|d}td|f|}|xI|D]A}|j}||=td|f|}|jt||q8WdS(NcWsdS(Ni((tstargs((s1/usr/local/lib/python2.7/test/test_collections.pytstC(R@tfromkeysttypeRtR%R)(R+RRct methodstubsRRftstubs((s1/usr/local/lib/python2.7/test/test_collections.pytvalidate_abstract_methodss  cCsd}tdtfi||6}|j|||jt||dddY}t||||j|||jt||tdtfidd6}|j|||jt||dddY}|j|||jt||dS(NcWsdS(Ni((RR((s1/usr/local/lib/python2.7/test/test_collections.pyRsRcBseZRS((RR!(((s1/usr/local/lib/python2.7/test/test_collections.pyRst__hash__cBseZRS((RR!(((s1/usr/local/lib/python2.7/test/test_collections.pyR's((( RtobjectRJt assertTruet issubclasstsetattrtNonetassertNotIsInstancet assertFalse(R+RRftstubR((s1/usr/local/lib/python2.7/test/test_collections.pytvalidate_isinstances c Csddddddddd g }i}x/|D]'}d |d }tt|||rstIcseZfdZRS(cst|jS(N(Rt__iter__(R+(R(s1/usr/local/lib/python2.7/test/test_collections.pyRys(RR!R((R(s1/usr/local/lib/python2.7/test/test_collections.pyRxsR(RRRRRRR(RR#RKR]RR@tkeysRRRJRRRR(R+RRR((Rs1/usr/local/lib/python2.7/test/test_collections.pyt test_Iterablegs" /$  /c Csdddddjdddgitg }xI|D]A}|j|t|jtt|ttt|q7Wt t t t t t t t t tt tt t jt t jt t jddgDg }xI|D]A}|j|t|jtt|ttt|qW|jtdd d dd Y}|j|td tfd Y}|j|tdS(Ni*gQ @y?R7tasciicss dVdS(N((((s1/usr/local/lib/python2.7/test/test_collections.pyRscss|] }|VqdS(N((RWR((s1/usr/local/lib/python2.7/test/test_collections.pys stnextRtNextOnlycBseZdZRS(cssdVtdS(Ni(t StopIteration(R+((s1/usr/local/lib/python2.7/test/test_collections.pyt__next__s(RR!R(((s1/usr/local/lib/python2.7/test/test_collections.pyRst NextOnlyNewcBseZdZRS(cssdVtdS(Ni(R(R+((s1/usr/local/lib/python2.7/test/test_collections.pyRs(RR!R(((s1/usr/local/lib/python2.7/test/test_collections.pyRs(((RtencodeR]RR RRRR(titerRR#RKR@RRRRRJRRR(R+RRRRR((s1/usr/local/lib/python2.7/test/test_collections.pyt test_Iterators(! / $$  /c Cs2ddddddgDg}xI|D]A}|j|t|jtt|ttt|q/Wttt t t t t j t jt jg }xI|D]A}|j|t|jtt|ttt|qW|jtd|jtddS(Ni*gQ @y?css dVdS(N((((s1/usr/local/lib/python2.7/test/test_collections.pyRscss|] }|VqdS(N((RWR((s1/usr/local/lib/python2.7/test/test_collections.pys st__len__(RRR RRRR(RR#RKR]RR@RRRRJRRR(R+RRR((s1/usr/local/lib/python2.7/test/test_collections.pyt test_Sizeds   /* /cCs&ddddddgDg}xI|D]A}|j|t|jtt|ttt|q/Wttt t t t t j t jg}xI|D]A}|j|t|jtt|ttt|qW|jtd|jtddS(Ni*gQ @y?css dVdS(N((((s1/usr/local/lib/python2.7/test/test_collections.pyRscss|] }|VqdS(N((RWR((s1/usr/local/lib/python2.7/test/test_collections.pys st __contains__(RRR RRRR(RR#RKR]RR@RRRJRRR(R+RRR((s1/usr/local/lib/python2.7/test/test_collections.pyttest_Containers   / /c Cs&ddddddjdd gitddgDg }xI|D]A}|j|t|jtt|ttt|qMWdtt t t t j gj g}xI|D]A}|j|t|jtt|ttt|qW|jtd |jtd dS( Ni*gQ @y?R7Rcss dVdS(N((((s1/usr/local/lib/python2.7/test/test_collections.pyRscss|] }|VqdS(N((RWR((s1/usr/local/lib/python2.7/test/test_collections.pys scSsdS(N(R(((s1/usr/local/lib/python2.7/test/test_collections.pyRst__call__((RRR]RR RRRR(RRR^RKtappendRJRRR(R+RRR((s1/usr/local/lib/python2.7/test/test_collections.pyt test_Callables    /  /cCsixbttttttfD]H}d|fdY}|jt|||jtt |qWdS(NRcBseZRS((RR!(((s1/usr/local/lib/python2.7/test/test_collections.pyRs( RRR R R R RRRR(R+tBR((s1/usr/local/lib/python2.7/test/test_collections.pyttest_direct_subclassingscCsyxrttttttfD]X}dddY}|jt|||j|j ||j t||qWdS(NRcBseZeZdZRS(N(RR!Rt __metaclass__RR(((s1/usr/local/lib/python2.7/test/test_collections.pyRs(( RRR R R R RRRtregisterR(R+RR((s1/usr/local/lib/python2.7/test/test_collections.pyttest_registrations  ( RR!RRRRRRRR(((s1/usr/local/lib/python2.7/test/test_collections.pyRJs       tWithSetcBsAeZddZdZdZdZdZdZRS(cCst||_dS(N(R]tdata(R+tit((s1/usr/local/lib/python2.7/test/test_collections.pyRscCs t|jS(N(R^R(R+((s1/usr/local/lib/python2.7/test/test_collections.pyRscCs t|jS(N(RR(R+((s1/usr/local/lib/python2.7/test/test_collections.pyRscCs ||jkS(N(R(R+titem((s1/usr/local/lib/python2.7/test/test_collections.pyRscCs|jj|dS(N(Rtadd(R+R((s1/usr/local/lib/python2.7/test/test_collections.pyRscCs|jj|dS(N(Rtdiscard(R+R((s1/usr/local/lib/python2.7/test/test_collections.pyRs((RR!RRRRRR(((s1/usr/local/lib/python2.7/test/test_collections.pyRs      tTestCollectionABCscBs}eZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d ZRS( cCsx=ttgD]/}|j|t|jt|tq W|jtddddtfdY}|j|dS(NRRRtMySetcBs#eZdZdZdZRS(cSstS(N(R(R+R((s1/usr/local/lib/python2.7/test/test_collections.pyRscSsdS(Ni((R+((s1/usr/local/lib/python2.7/test/test_collections.pyR scSs tgS(N(R(R+((s1/usr/local/lib/python2.7/test/test_collections.pyR s(RR!RRR(((s1/usr/local/lib/python2.7/test/test_collections.pyRs  (R]RRJR RRRR(R+tsampleR((s1/usr/local/lib/python2.7/test/test_collections.pyttest_Sets cCsLdtfdY}||}}|jt|t|kdS(NtOneTwoThreeSetcBs5eZdZdZdZdZdZRS(cSsdddg|_dS(Niii(tcontents(R+((s1/usr/local/lib/python2.7/test/test_collections.pyRscSs ||jkS(N(R(R+R((s1/usr/local/lib/python2.7/test/test_collections.pyRscSs t|jS(N(R^R(R+((s1/usr/local/lib/python2.7/test/test_collections.pyRscSs t|jS(N(RR(R+((s1/usr/local/lib/python2.7/test/test_collections.pyRscSs |jS(N(t_hash(R+((s1/usr/local/lib/python2.7/test/test_collections.pyRs(RR!RRRRR(((s1/usr/local/lib/python2.7/test/test_collections.pyRs     (R RR(R+RtaRd((s1/usr/local/lib/python2.7/test/test_collections.pyt test_hash_Sets cCsr|jtt|jttt|jtt|jttt|jtddddddS(NRRRRR( RJR]RRRRRRR(R+((s1/usr/local/lib/python2.7/test/test_collections.pyttest_MutableSets cCs<td}|tdM}|jt|tddS(Ntabcdtcdeftcd(RRR](R+R((s1/usr/local/lib/python2.7/test/test_collections.pyttest_issue_5647&s cCsKdtjfdY}|ddddg}|j|jddS(NRcBsSeZdgZddZdZdZdZdZdZ dZ RS( t__scSs(|dkrg}nt||_dS(N(RR]t _MySet__s(R+R((s1/usr/local/lib/python2.7/test/test_collections.pyR0s  cSs ||jkS(N(R(R+R}((s1/usr/local/lib/python2.7/test/test_collections.pyR4scSs t|jS(N(RR(R+((s1/usr/local/lib/python2.7/test/test_collections.pyR6scSs t|jS(N(R^R(R+((s1/usr/local/lib/python2.7/test/test_collections.pyR8scSs#||jk}|jj||S(N(RR(R+R}tresult((s1/usr/local/lib/python2.7/test/test_collections.pyR:scSs#||jk}|jj||S(N(RR(R+R}R((s1/usr/local/lib/python2.7/test/test_collections.pyR>scSsdtt|S(Ns MySet(%s)(R(RK(R+((s1/usr/local/lib/python2.7/test/test_collections.pyt__repr__BsN( RR!R RRRRRRRR(((s1/usr/local/lib/python2.7/test/test_collections.pyR.s       ii+ii(t collectionsRRtpop(R+RR((s1/usr/local/lib/python2.7/test/test_collections.pyttest_issue_4920,scCst}ttd}t|}||8}|j||t|}||N}|j||t|}||M}|j||||O}|j||dS(Ni (RRTR(R+temptytfullR((s1/usr/local/lib/python2.7/test/test_collections.pyttest_issue8750Gs        cCsdtfdY}dtfdY}|}|}||k||k||k||k||k||k||k||kdS(NtMyComparableSetcBs#eZdZdZdZRS(cSstS(N(R(R+R((s1/usr/local/lib/python2.7/test/test_collections.pyRZscSsdS(Ni((R+((s1/usr/local/lib/python2.7/test/test_collections.pyR\scSs tgS(N(R(R+((s1/usr/local/lib/python2.7/test/test_collections.pyR^s(RR!RRR(((s1/usr/local/lib/python2.7/test/test_collections.pyR Ys  tMyNonComparableSetcBs5eZdZdZdZdZdZRS(cSstS(N(R(R+R((s1/usr/local/lib/python2.7/test/test_collections.pyRascSsdS(Ni((R+((s1/usr/local/lib/python2.7/test/test_collections.pyRcscSs tgS(N(R(R+((s1/usr/local/lib/python2.7/test/test_collections.pyRescSstS(N(tNotImplemented(R+R((s1/usr/local/lib/python2.7/test/test_collections.pyRgscSstS(N(R(R+R((s1/usr/local/lib/python2.7/test/test_collections.pyRis(RR!RRRRR(((s1/usr/local/lib/python2.7/test/test_collections.pyR `s     (R (R+R R tcstncs((s1/usr/local/lib/python2.7/test/test_collections.pyttest_issue16373Vs         cCs |jt|t|dS(N(RR](R+ts1ts2((s1/usr/local/lib/python2.7/test/test_collections.pyt assertSameSetyscCsdtfdY}td}td}td}|d}|d}|d}td}td} td} tjd} tjd} tjd} ||@}|j||@||j||@||j||@||j|| @||j| |@||j|| @|||B}|j||B||j||B||j||B||j|| B||j| |B||j|| B|||}||}|j||||j||||j||||j||||j||||j||||j|| ||j|| ||j| |||j| |||j|| ||j|||||A}|j||A||j||A||j||A||j|| A||j| |A||j|| A||j||k|j||k|j||k|j||k|j||k|j||k|j||k|j||k|j||k|| k||k|| k|j||k|j||k|j||k|j||k|j||k|j||k|j||k|j||k|j||k|| k||k|| k|j||k|j||k|j||k|j||k|j||k|j||k|j||k|j||k|j||k|| k||k|| k|j||k|j||k|j||k|j||k|j||k|j||k|j||k|j||k|j||k|| k||k|| k|j||k|j||k|j||k|j||k|j||k|j||k|| k||k|| k|j||k|j||k|j||k|j||k|j||k|j||k|| k||k|| kdS( NtListSetcBs8eZddZdZdZdZdZRS(cSs@g|_x0|D](}||jkr|jj|qqWdS(N(RR(R+telementstelem((s1/usr/local/lib/python2.7/test/test_collections.pyRs  cSs ||jkS(N(R(R+R((s1/usr/local/lib/python2.7/test/test_collections.pyRscSs t|jS(N(RR(R+((s1/usr/local/lib/python2.7/test/test_collections.pyRscSs t|jS(N(R^R(R+((s1/usr/local/lib/python2.7/test/test_collections.pyRscSsdj|jS(Ns Set({!r})(tformatR(R+((s1/usr/local/lib/python2.7/test/test_collections.pyRs((RR!RRRRR(((s1/usr/local/lib/python2.7/test/test_collections.pyRs     Rtbcdtabcdetabccbatbcddcbt abcdeedcba(R R]RKtsetsRRR(R+Rtr1tr2tr3tf1tf2tf3tl1tl2tl3tp1tp2tp3ttargett fwd_targett rev_target((s1/usr/local/lib/python2.7/test/test_collections.pyt(test_Set_interoperability_with_real_sets}s                               cCsx:tgD]/}|j|t|jt|tq W|jtdddddtjfdY}|j|dS(NRRRR"t MyMappingcBs#eZdZdZdZRS(cSsdS(Ni((R+((s1/usr/local/lib/python2.7/test/test_collections.pyRscSs tdS(N(RM(R+RX((s1/usr/local/lib/python2.7/test/test_collections.pyR"scSs tdS(N((R(R+((s1/usr/local/lib/python2.7/test/test_collections.pyR!s(RR!RR"R(((s1/usr/local/lib/python2.7/test/test_collections.pyR/s  (R@RJRRRRRR(R+RR/((s1/usr/local/lib/python2.7/test/test_collections.pyt test_MappingscCs`x:tgD]/}|j|t|jt|tq W|jtdddddddS(NRRRR"t __setitem__t __delitem__(R@RJRRRR(R+R((s1/usr/local/lib/python2.7/test/test_collections.pyttest_MutableMapping%s cCsx@tttgD]/}|j|t|jt|tqW|jttt|jtdt|jtt t|jttt|j tdddddS(Ni RRRR"( R#RKRRJRRRt basestringRTtxrangeR(R+R((s1/usr/local/lib/python2.7/test/test_collections.pyt test_Sequence,sc Csx=ttgD]/}|j|t|jt|tq Wx:tgD]/}|j|t|jt|tqJW|jtt t|j tddddddddS(NRRRR"R1R2tinsert( R#RRRRRRKRJRR4R(R+R((s1/usr/local/lib/python2.7/test/test_collections.pyttest_MutableSequence7s(RR!RRRRRR RRR.R0R3R6R8(((s1/usr/local/lib/python2.7/test/test_collections.pyRs       #    t TestCountercBsGeZdZdZdZdZdZdZdZRS(cCsxtd}|j|tidd6dd6dd6|j|tdddddd|j|t|j|t|jttt|jttt|jt|d|jt|j d|jt |j dddg|jt |j dddg|jt |dddg|jt |j d d!d"g|j|dd|j|d d t j7|j|jdt|j|jd tWdQX|j|jdt|j|jd t|j|jdd d|j|jd d d |j|tdddddd|jt|d |j|jd#d$d%gx:td D],}|j|j|d&d'd(g| qW|jdjt |jd|dcd7<|dcd8<|d=|d=|dcd8sR=iR>itgcss$|]}|tddfVqdS(iiN(R(RWR((s1/usr/local/lib/python2.7/test/test_collections.pys sthRXRYcSstd||S(Ni(RL(RR((s1/usr/local/lib/python2.7/test/test_collections.pyRscSstd||S(Ni(RL(RR((s1/usr/local/lib/python2.7/test/test_collections.pyRscSstd||S(Ni(RL(RR((s1/usr/local/lib/python2.7/test/test_collections.pyRscSstdt||S(Ni(RLtmin(RR((s1/usr/local/lib/python2.7/test/test_collections.pyRscss|]}|dkVqdS(iN((RWR((s1/usr/local/lib/python2.7/test/test_collections.pys stabcdefidcss$|]}|tddfVqdS(iiN(R(RWR((s1/usr/local/lib/python2.7/test/test_collections.pys scss$|]}|tddfVqdS(iiN(R(RWR((s1/usr/local/lib/python2.7/test/test_collections.pys s(RRR@RTRJt__add__t__sub__t__or__t__and__RRR]RR( R+R;RRXRHRrt counteroptnumberopRRtsetoptcounter_resultt set_result((s1/usr/local/lib/python2.7/test/test_collections.pyttest_multiset_operationss:" !%'cCstddddddddd d d d }|jdd ddddddd ddddd|j|tddddddddd dddd d ddtddddddddd d d d }|jtdd ddddddd ddddd|j|tddddddddd dddd d ddtd}|jd|j|tdddddddd d ddS(NRiRdiR;iRRi R=iRYi(iiiiR>iRZiiiiii2taaabbcdt aaaabbccei(RtsubtractR(R+R;((s1/usr/local/lib/python2.7/test/test_collections.pyt test_subtracts-4C-:C  ( RR!RMRRRURVRXRfRj(((s1/usr/local/lib/python2.7/test/test_collections.pyR9Bs ?    'tTestOrderedDictcBseZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZdZdZdZRS(c Cs|jttddgdWdQXdddddg}|jttt|j||jttt|j||jtt|j||jttddddgddd d j||jt j tj d j d gtdd d!d"d#g}|j d$d%gdddd|jt|jd&d'd(d)d*d+d,gdS(-NRiRdiR;iRRiR=ii RR+i,i7R>iRYi(Ri(Rdi(Ri(Rdi(R;i(RRi(R=i(Ri(Rdi(R;i (RRi(Ri(Rdi(R;i(RRi,(R=i7(R=i(R>i(Ri(Rdi(R;i(RRi(R=i(R>i(RYi(R%R)RRRRBR@RRKtinspectt getargspect__dict__RR(R+tpairsRR((s1/usr/local/lib/python2.7/test/test_collections.pyt test_inits((" c Csn|jttjddgdWdQXdddddg}t}|jt||jt|j|t}|jt||jt|j|t}|j||jt |j|t}|jdd d!d"gddd d |jt |j|t}|jd d |jt |jd#gt}|jdi|jt |jdifgt}|jdd ddddd d|jtt |jd$d%d&d'gtd(d)d*d+d,g}|jd-d.gdddd|jt |jd/d0d1d2d3d4d5gdS(6NRiRdiR;iRRiR=ii R+iRtredtblueiiii,i7R>RY(Ri(Rdi(Ri(Rdi(R;i(RRi(R=i(Ri(Rdi(R;i (RRi(R+i(Rri(Ri(Rqi(R+i(Ri(Rdi(R;i(RRi,(R=i7(R=i(R>i(Ri(Rdi(R;i(RRi(R=i(R>i(RYi( R%R)RRJRR@RRBRRK(R+RotodRR((s1/usr/local/lib/python2.7/test/test_collections.pyt test_updates:     %  % "cCs-|jtt|jtttdS(N(RJRRRR(R+((s1/usr/local/lib/python2.7/test/test_collections.pyttest_abc#scCsnddddddg}t|t|}|jt|t||j|jt|d dS(NR;iRdiRiRRiR=iR>ii(R;i(Rdi(Ri(RRi(R=i(R>i(RRRR^RH(R+RoRs((s1/usr/local/lib/python2.7/test/test_collections.pyt test_clear's    cCsd dddddg}t|}|d=|jd||jt |d=WdQX|jt|j|d |ddS(NR;iRdiRiRRiR=iR>i(R;i(Rdi(Ri(RRi(R=i(R>i(RR'R%tKeyErrorRRKR(R+RoRs((s1/usr/local/lib/python2.7/test/test_collections.pyt test_delitem/s  c Csatdddddg}d |d(RRi(Rdi(R;i(Ri(R=i(RRi(Rdi(R;i (Ri(R=i(R>i(RRRKR(R+Rs((s1/usr/local/lib/python2.7/test/test_collections.pyt test_setitem8s   cCsddddddg}t|t|}|jt|g|D]}|d ^qD|j|jg|D]}|d ^qr|j|jg|D]}|d^q|j|j||jt|jg|D]}|d ^q|jt|jg|D]}|d^q|jt|j ||jtt |gt |D]}|d ^qrdS(NR;iRdiRiRRiR=iR>ii(R;i(Rdi(Ri(RRi(R=i(R>i( RRRRKRRRtiterkeyst itervaluest iteritemstreversed(R+RoRsR((s1/usr/local/lib/python2.7/test/test_collections.pyttest_iterators?s  -..33cCsddddddg}t|t|}x&|rV|j|j|jq1W|jt|jWdQX|jt|d dS(NR;iRdiRiRRiR=iR>ii(R;i(Rdi(Ri(RRi(R=i(R>i(RRRRGRR%RwR^(R+RoRs((s1/usr/local/lib/python2.7/test/test_collections.pyt test_popitemMs    cCseddddddg}t|t|}t|x5|ro|j\}}|j|j||q;W|jt|jd WdQX|jt|d|j|j|dddtfdY}|dd}|j|jdd d |j|jdd d|j|jdd d |jt|jdWdQXdS(NR;iRdiRiRRiR=iR>itxyzii90tMissingcBseZdZRS(cSsdS(Ni((R+tkey((s1/usr/local/lib/python2.7/test/test_collections.pyt __missing__fs(RR!R(((s1/usr/local/lib/python2.7/test/test_collections.pyRes(R;i(Rdi(Ri(RRi(R=i(R>i(RRRRR%RwR^(R+RoRstkR}Rtm((s1/usr/local/lib/python2.7/test/test_collections.pyttest_popWs$    cCsddddddg}t|t|}t|}|j|||d|d }t|}|j|||j|t||jt|||j|t|d dS(NR;iRdiRiRRiR=iR>ii(R;i(Rdi(Ri(RRi(R=i(R>i(RRRtassertNotEqualR@(R+Rotod1tod2((s1/usr/local/lib/python2.7/test/test_collections.pyt test_equalityos    c Cszddddddg}t|}t}|j|x9t|jtj|tj|tjtj|d tjtj|dtjtj|dtjtj|dtt ||t|g D]\}}|j ||k |j |||j t |j t |j |j t|t||j t|t|qWdS(NR;iRdiRiRRiR=iR>iii(R;i(Rdi(Ri(RRi(R=i(R>i(RRJR_RtRuRnRlRmRAR(RRRKRR^R(R+RoRsRORXRP((s1/usr/local/lib/python2.7/test/test_collections.pyRR~s(      (cCsOddddddg}t|}|jtd |jdDdS(NR;iRdiRiRRiR=iR>icss!|]}t|tkVqdS(N(RRK(RWtpair((s1/usr/local/lib/python2.7/test/test_collections.pys s(R;i(Rdi(Ri(RRi(R=i(R>i(RRtallt __reduce__(R+RoRs((s1/usr/local/lib/python2.7/test/test_collections.pyttest_yaml_linkages cCsiddddddg}t|}|jt|jdd |_|jt|jddS(NR;iRdiRiRRiR=iR>ii (R;i(Rdi(Ri(RRi(R=i(R>i(RRR^RR(R+RoRs((s1/usr/local/lib/python2.7/test/test_collections.pyttest_reduce_not_too_fats   cCsmtddddddg}|jt|d |jtt|||jttddS(NR;iRdiRiRRiR=iR>isIOrderedDict([('c', 1), ('b', 2), ('a', 3), ('d', 4), ('e', 5), ('f', 6)])s OrderedDict()(R;i(Rdi(Ri(RRi(R=i(R>i(RRR(RA(R+Rs((s1/usr/local/lib/python2.7/test/test_collections.pyt test_reprs cCs3tjd}||d<|jt|ddS(NRRs@OrderedDict([('a', None), ('b', None), ('c', None), ('x', ...)])(RRRR((R+Rs((s1/usr/local/lib/python2.7/test/test_collections.pyttest_repr_recursives cCsddddddg}t|t|}t|j}|j|jdd d|jt|j||j|jdd d |jt|jdddtfdY}|j|jd dddS(NR;iRdiRiRRiR=iR>ii RiRcBseZdZRS(cSsdS(Ni((R+R((s1/usr/local/lib/python2.7/test/test_collections.pyRs(RR!R(((s1/usr/local/lib/python2.7/test/test_collections.pyRsi (R;i(Rdi(Ri(RRi(R=i(R>i(Ri (RRRKRRRK(R+RoRst pair_orderR((s1/usr/local/lib/python2.7/test/test_collections.pyttest_setdefaults   cCsTt}d|ds@$ $    %EH