ó {G_Tc@sìddlZddlmZddlZddlZddlZddlZddlZdejfd„ƒYZ ddlm Z de j fd„ƒYZ de fd „ƒYZd e j fd „ƒYZd „Zed krèeƒndS(iÿÿÿÿN(t test_supporttDictTestcBsUeZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z d „Z d „Z d „Z d „Zd „Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z e!j"d„ƒZ#e!j"d „ƒZ$e!j"d!„ƒZ%RS("cCs*|jtƒiƒ|jtƒiƒdS(N(t assertEqualtdictt assertIsNot(tself((s*/usr/local/lib/python2.7/test/test_dict.pyttest_constructor scCs¢x›d D]“}gt|ƒD]*}djtjtjdƒƒ|f^q}tj|ƒd„|Dƒ}d d j|ƒd }|jt|ƒt |ƒƒqWdS( Niiiiiticss'|]\}}dj||ƒVqdS(s {!r}: {:d}N(tformat(t.0tktv((s*/usr/local/lib/python2.7/test/test_dict.pys st{s, t}(iiiii( trangetjointrandomtsampletstringtletterstshuffleRtevalR(Rtntititemstformatted_itemst dictliteral((s*/usr/local/lib/python2.7/test/test_dict.pyttest_literal_constructors : cCs\|ji tƒ|jidd6ƒ|jtiƒtƒ|jtidd6ƒtƒdS(Nii(tassertIstTruet assertTruetbooltFalse(R((s*/usr/local/lib/python2.7/test/test_dict.pyt test_boolscCs¾i}|j|jƒgƒidd6dd6}|jƒ}|jt|ƒddhƒ|jd|ƒ|jd|ƒ|j|jdƒƒ|j|jdƒƒ|jt|jdƒdS(Nitaitb( RtkeystsettassertInRthas_keyt assertRaisest TypeErrortNone(RtdR ((s*/usr/local/lib/python2.7/test/test_dict.pyt test_keyss cCs\i}|j|jƒgƒidd6}|j|jƒdgƒ|jt|jdƒdS(Nii(RtvaluesR(R)R*(RR+((s*/usr/local/lib/python2.7/test/test_dict.pyt test_values+s  cCs\i}|j|jƒgƒidd6}|j|jƒdgƒ|jt|jdƒdS(Nii(ii(RRR(R)R*(RR+((s*/usr/local/lib/python2.7/test/test_dict.pyt test_items3s  cCssi}|j|jdƒƒidd6dd6}|jƒ}|jƒ|j|ddgƒ|jt|jƒdS(NR"iiR#(t assertFalseR'R$tsortRR(R)(RR+R ((s*/usr/local/lib/python2.7/test/test_dict.pyt test_has_key<s  cCs—i}|jd|ƒ|jd|kƒ|jd|kƒidd6dd6}|jd|ƒ|jd|ƒ|jd|ƒ|jt|jƒdS(NR"iiR#tc(t assertNotInR0RR&R(R)t __contains__(RR+((s*/usr/local/lib/python2.7/test/test_dict.pyt test_containsFscCsJi}|jt|ƒdƒidd6dd6}|jt|ƒdƒdS(NiiR"iR#(Rtlen(RR+((s*/usr/local/lib/python2.7/test/test_dict.pyttest_lenRscs]idd6dd6}|j|ddƒ|j|ddƒd|dR?(((s*/usr/local/lib/python2.7/test/test_dict.pyR;ostBadHashcseZeZ‡fd†ZRS(cs|jrˆƒ‚ndSdS(Ni*(tfail(R(R;(s*/usr/local/lib/python2.7/test/test_dict.pyR=ss  (R>R?R RAR=((R;(s*/usr/local/lib/python2.7/test/test_dict.pyR@qs( RR(R)t __getitem__tobjecttKeyErrort ExceptionRRA(RR+R9R@tx((R;s*/usr/local/lib/python2.7/test/test_dict.pyt test_getitemXs(      cCsOidd6dd6dd6}|jƒ|j|iƒ|jt|jdƒdS(Niii(tclearRR(R)R*(RR+((s*/usr/local/lib/python2.7/test/test_dict.pyt test_clear~s csi}|jidd6ƒ|jidd6ƒ|jidd6dd6dd6ƒ|j|idd6dd6dd6ƒ|jƒ|j|idd6dd6dd6ƒ|jttf|jdƒddd„ƒY}|jƒ|j|ƒƒ|j|idd6dd6dd6ƒdtfd „ƒY‰|jƒd d‡fd †ƒY}|jˆ|j|ƒƒd d‡fd †ƒY}|jˆ|j|ƒƒd d‡fd †ƒY}|jˆ|j|ƒƒdtf‡fd†ƒY}|jˆij|ƒƒ|jt ijdgƒdS(NidiiiitSimpleUserDictcBs#eZd„Zd„Zd„ZRS(cSs"idd6dd6dd6|_dS(Niii(R+(R((s*/usr/local/lib/python2.7/test/test_dict.pyt__init__’scSs |jjƒS(N(R+R$(R((s*/usr/local/lib/python2.7/test/test_dict.pyR$”scSs |j|S(N(R+(RR((s*/usr/local/lib/python2.7/test/test_dict.pyRB–s(R>R?RKR$RB(((s*/usr/local/lib/python2.7/test/test_dict.pyRJ‘s  R;cBseZRS((R>R?(((s*/usr/local/lib/python2.7/test/test_dict.pyR;œstFailingUserDictcseZ‡fd†ZRS(cs ˆ‚dS(N((R(R;(s*/usr/local/lib/python2.7/test/test_dict.pyR$ s(R>R?R$((R;(s*/usr/local/lib/python2.7/test/test_dict.pyRLŸscs eZ‡fd†Zd„ZRS(cs dd‡fd†ƒY}|ƒS(Nt BogonItercs)eZd„Zd„Z‡fd†ZRS(cSs d|_dS(Ni(R(R((s*/usr/local/lib/python2.7/test/test_dict.pyRK§scSs|S(N((R((s*/usr/local/lib/python2.7/test/test_dict.pyt__iter__©scs |jrd|_dSˆ‚dS(NiR"(R(R(R;(s*/usr/local/lib/python2.7/test/test_dict.pytnext«s  (R>R?RKRNRO((R;(s*/usr/local/lib/python2.7/test/test_dict.pyRM¦s  (((RRM(R;(s*/usr/local/lib/python2.7/test/test_dict.pyR$¥s cSs|S(N((Rtkey((s*/usr/local/lib/python2.7/test/test_dict.pyRB±s(R>R?R$RB((R;(s*/usr/local/lib/python2.7/test/test_dict.pyRL¤s cs eZd„Z‡fd†ZRS(cSsddd„ƒY}|ƒS(NRMcBs#eZd„Zd„Zd„ZRS(cSstdƒ|_dS(NR"(tordR(R((s*/usr/local/lib/python2.7/test/test_dict.pyRK¸scSs|S(N((R((s*/usr/local/lib/python2.7/test/test_dict.pyRNºscSsA|jtdƒkr7t|jƒ}|jd7_|St‚dS(Ntzi(RRQtchrt StopIteration(Rtrtn((s*/usr/local/lib/python2.7/test/test_dict.pyRO¼s (R>R?RKRNRO(((s*/usr/local/lib/python2.7/test/test_dict.pyRM·s  (((RRM((s*/usr/local/lib/python2.7/test/test_dict.pyR$¶s cs ˆ‚dS(N((RRP(R;(s*/usr/local/lib/python2.7/test/test_dict.pyRBÃs(R>R?R$RB((R;(s*/usr/local/lib/python2.7/test/test_dict.pyRLµs tbadseqcs eZd„Z‡fd†ZRS(cSs|S(N((R((s*/usr/local/lib/python2.7/test/test_dict.pyRNÈscs ˆƒ‚dS(N((R(R;(s*/usr/local/lib/python2.7/test/test_dict.pyROÊs(R>R?RNRO((R;(s*/usr/local/lib/python2.7/test/test_dict.pyRVÇs (((((iii( tupdateRR(R)tAttributeErrorR*RHRERCt ValueError(RR+RJRLRV((R;s*/usr/local/lib/python2.7/test/test_dict.pyt test_update…s."% % % c s…|jtjdƒidd6dd6dd6ƒi‰|jˆjdƒˆƒ|jˆjdƒidd6dd6dd6ƒ|jˆjddƒidd6dd6ƒ|jˆjgƒiƒd„}|jˆj|ƒƒidd 6ƒ|jtijd ƒd tfd „ƒY}|j|jdƒidd6ƒ|j|ƒjdƒidd6ƒ|j|jdƒ|ƒ|j|ƒjdƒ|ƒd tfd„ƒY}|jdƒ}|j|idd6dd6ƒ|j|tjƒ|jttjƒdt fd„ƒY‰dtf‡fd†ƒY}|jˆ|jd gƒdt f‡fd†ƒY}|jˆtj|ƒƒdtf‡fd†ƒY}|jˆ|jd gƒtt t dƒt dƒƒƒ‰|jtjˆdƒtt t dƒdgdƒƒƒdtf‡fd†ƒY}d„t dƒDƒ‰ˆj ƒ} | jddddddƒ|j|jdddhƒ| ƒdS(NtabcR"R#R3iiicss dVdS(Ni((((s*/usr/local/lib/python2.7/test/test_dict.pytgØsiitdictlikecBseZRS((R>R?(((s*/usr/local/lib/python2.7/test/test_dict.pyR]ÜstmydictcBseZd„ZRS(cSs tjƒS(N(tUserDict(tcls((s*/usr/local/lib/python2.7/test/test_dict.pyt__new__âs(R>R?Ra(((s*/usr/local/lib/python2.7/test/test_dict.pyR^ástabR;cBseZRS((R>R?(((s*/usr/local/lib/python2.7/test/test_dict.pyR;éstbaddict1cseZ‡fd†ZRS(cs ˆƒ‚dS(N((R(R;(s*/usr/local/lib/python2.7/test/test_dict.pyRKìs(R>R?RK((R;(s*/usr/local/lib/python2.7/test/test_dict.pyRcëstBadSeqcs eZd„Z‡fd†ZRS(cSs|S(N((R((s*/usr/local/lib/python2.7/test/test_dict.pyRNòscs ˆƒ‚dS(N((R(R;(s*/usr/local/lib/python2.7/test/test_dict.pyROôs(R>R?RNRO((R;(s*/usr/local/lib/python2.7/test/test_dict.pyRdñs tbaddict2cseZ‡fd†ZRS(cs ˆƒ‚dS(N((RRPtvalue(R;(s*/usr/local/lib/python2.7/test/test_dict.pyt __setitem__ús(R>R?Rg((R;(s*/usr/local/lib/python2.7/test/test_dict.pyReùsitbaddict3cseZ‡fd†ZRS(csˆS(N((R`(R+(s*/usr/local/lib/python2.7/test/test_dict.pyRas(R>R?Ra((R+(s*/usr/local/lib/python2.7/test/test_dict.pyRhscSsi|]}||“qS(((R R((s*/usr/local/lib/python2.7/test/test_dict.pys s i (ii(RRtfromkeysR*RR(R)tassertIsInstanceR_RERCtzipRtcopyRW( RR\R]R^tudRcRdReRhtres((R;R+s*/usr/local/lib/python2.7/test/test_dict.pyt test_fromkeysÑsB..* # #!8 cCsvidd6dd6dd6}|j|jƒidd6dd6dd6ƒ|jijƒiƒ|jt|jdƒdS(Niii(RRlR(R)R*(RR+((s*/usr/local/lib/python2.7/test/test_dict.pyt test_copy s+cCsìi}|j|jdƒdƒ|j|jddƒdƒidd6dd6}|j|jdƒdƒ|j|jddƒdƒ|j|jdƒdƒ|j|jddƒdƒ|jt|jƒ|jt|jdddƒdS(NR3iiR"iR#(RtgetR*RR(R)(RR+((s*/usr/local/lib/python2.7/test/test_dict.pyttest_getscs*i}|j|jdƒdƒ|jdgƒ|j|jdƒdƒ|jdgƒjdƒ|j|dddƒ|jdgƒjdƒ|jt|dƒdƒ|jt|jƒdtfd„ƒY‰d t f‡fd †ƒY}|ƒ}d ||R?(((s*/usr/local/lib/python2.7/test/test_dict.pyR;)sR@cseZeZ‡fd†ZRS(cs|jrˆƒ‚ndSdS(Ni*(RA(R(R;(s*/usr/local/lib/python2.7/test/test_dict.pyR=-s  (R>R?R RAR=((R;(s*/usr/local/lib/python2.7/test/test_dict.pyR@+si*( Rt setdefaultR*tappendRR7R(R)RERCRRA(RR+R@RF((R;s*/usr/local/lib/python2.7/test/test_dict.pyttest_setdefaults   cCs‰dtfd„ƒY}|ƒ}id|6}|ƒ}|j|gƒ|j|jdƒ|j|jdƒ|j|j|jdƒdS(NtHashedcBs#eZd„Zd„Zd„ZRS(cSsd|_d|_dS(Ni(t hash_countteq_count(R((s*/usr/local/lib/python2.7/test/test_dict.pyRK;s cSs|jd7_dS(Nii*(Rx(R((s*/usr/local/lib/python2.7/test/test_dict.pyR=>scSs%|jd7_t|ƒt|ƒkS(Ni(Rytid(RR:((s*/usr/local/lib/python2.7/test/test_dict.pyR<As(R>R?RKR=R<(((s*/usr/local/lib/python2.7/test/test_dict.pyRw:s  ii(RCRtRRxRy(RRwthashed1tythashed2((s*/usr/local/lib/python2.7/test/test_dict.pyttest_setdefault_atomic8s   cCskxKdd fD]<}x3tdƒD]%}d|}i}i}xCt|ƒD]5}||t|ƒ<|dkrJ||t|ƒR?(((s*/usr/local/lib/python2.7/test/test_dict.pyR;€sR@cseZeZ‡fd†ZRS(cs|jrˆƒ‚ndSdS(Ni*(RA(R(R;(s*/usr/local/lib/python2.7/test/test_dict.pyR=„s  (R>R?R RAR=((R;(s*/usr/local/lib/python2.7/test/test_dict.pyR@‚si*(sabcRŒ( R(RDtpopRR7R)RERCRRA(RR+R R RFR|thR@((R;s*/usr/local/lib/python2.7/test/test_dict.pyttest_popgs*      c CsIi}d|d<|jtƒ$x|D]}d||dR?(((s*/usr/local/lib/python2.7/test/test_dict.pyR; stBadReprcseZ‡fd†ZRS(cs ˆƒ‚dS(N((R(R;(s*/usr/local/lib/python2.7/test/test_dict.pyt__repr__£s(R>R?R•((R;(s*/usr/local/lib/python2.7/test/test_dict.pyR”¢s(RRRERCR((RR+R”((R;s*/usr/local/lib/python2.7/test/test_dict.pyt test_repr—s  cs§|jiikƒ|jidd6idd6kƒdtfd„ƒY‰dtf‡fd†ƒY}id|ƒ6}idd6}|jˆƒ||kWdQXdS( NiillR;cBseZRS((R>R?(((s*/usr/local/lib/python2.7/test/test_dict.pyR;­stBadCmpcs eZ‡fd†Zd„ZRS(cs ˆƒ‚dS(N((RR:(R;(s*/usr/local/lib/python2.7/test/test_dict.pyR<°scSsdS(Ni*((R((s*/usr/local/lib/python2.7/test/test_dict.pyR=²s(R>R?R<R=((R;(s*/usr/local/lib/python2.7/test/test_dict.pyR—¯s(R0RERCR((RR—td1td2((R;s*/usr/local/lib/python2.7/test/test_dict.pyttest_le©s! c CsÁ|jttdƒƒ|jtidƒƒdtfd„ƒY}|idd6dd6ƒ}|j|ddƒ|j|ddƒ|jd|ƒ|jd|jƒƒ|j|ddƒd tfd „ƒY}|ƒ}|jtƒ}|dWdQX|j|jj dƒd tfd „ƒY}|ƒ}|jt ƒ}|dWdQX|j|jj dƒd tfd„ƒY}|ƒ} |jt ƒ}| dWdQX|j|jj dƒdS(Nt __missing__tDcBseZd„ZRS(cSsdS(Ni*((RRP((s*/usr/local/lib/python2.7/test/test_dict.pyR›Ås(R>R?R›(((s*/usr/local/lib/python2.7/test/test_dict.pyRœÄsiiiii*tEcBseZd„ZRS(cSst|ƒ‚dS(N(R’(RRP((s*/usr/local/lib/python2.7/test/test_dict.pyR›Ïs(R>R?R›(((s*/usr/local/lib/python2.7/test/test_dict.pyRÎstFcBseZd„ZRS(cSsd„|_dS(NcSsdS(N(R*(RP((s*/usr/local/lib/python2.7/test/test_dict.pytÙs(R›(R((s*/usr/local/lib/python2.7/test/test_dict.pyRK×s(R>R?RK(((s*/usr/local/lib/python2.7/test/test_dict.pyRžÖstGcBseZRS((R>R?(((s*/usr/local/lib/python2.7/test/test_dict.pyR ßs(i*(i*(i*( R0thasattrRRR4R$R(R’t exceptiontargsRD( RRœR+RteR3RžtfR R\((s*/usr/local/lib/python2.7/test/test_dict.pyt test_missing»s0   cCs@i}|jtƒ}|dWdQX|j|jjdƒdS(Ni(i(i((i(R(RDRR¢R£(RR+R3((s*/usr/local/lib/python2.7/test/test_dict.pyttest_tuple_keyerroræscsŸdefd„ƒY‰dd‡fd†ƒY}i}|ƒ}|ƒ}d||R?(((s*/usr/local/lib/python2.7/test/test_dict.pyR¨ïst BadDictKeycs eZd„Z‡fd†ZRS(cSs t|jƒS(N(thasht __class__(R((s*/usr/local/lib/python2.7/test/test_dict.pyR=óscst||jƒrˆ‚n|S(N(t isinstanceR«(RR:(R¨(s*/usr/local/lib/python2.7/test/test_dict.pyt__cmp__ös (R>R?R=R­((R¨(s*/usr/local/lib/python2.7/test/test_dict.pyR©òs is d[x2] = 2s z = d[x2]sx2 in ds d.has_key(x2)s d.get(x2)sd.setdefault(x2, 42)s d.pop(x2)sd.update({x2: 2})((RER(tlocals(RR©R+tx1tx2tstmt((R¨s*/usr/local/lib/python2.7/test/test_dict.pyt test_bad_keyís      cCsmi}xtdƒD]}|||R?R=R<((R+Rµ(s*/usr/local/lib/python2.7/test/test_dict.pyR´s iiiiiii (RCR R(RR´((R+Rµs*/usr/local/lib/python2.7/test/test_dict.pyt test_resize2s     cCsb|jtƒGiddd6dd6dd6dd6dd6dd6dd 6dd 6}WdQXi}dS( NiiR"R#R3R+R¤R¥R\R(R(tZeroDivisionErrorR*(RR+((s*/usr/local/lib/python2.7/test/test_dict.pyt$test_empty_presized_dict_in_freelist0s*cCsdtfd„ƒY}tjtjtjf}xh|D]`}|ƒ}tj|ƒ}id|6}||ƒ|_~~tj ƒ|j |ƒddƒq5WdS(NtCcBseZRS((R>R?(((s*/usr/local/lib/python2.7/test/test_dict.pyR¹:sisCycle was not collected( RCRt iteritemst itervaluestiterkeystweakreftrefRFtgctcollectRR*(RR¹t iteratorsRtobjR¾t container((s*/usr/local/lib/python2.7/test/test_dict.pyttest_container_iterator8s    cCs1tjƒtjƒ|jtj|ƒ|ƒdS(N(R¿RÀR0t is_tracked(Rtt((s*/usr/local/lib/python2.7/test/test_dict.pyt _not_trackedFs  cCsJ|jtj|ƒ|ƒtjƒtjƒ|jtj|ƒ|ƒdS(N(RR¿RÅRÀ(RRÆ((s*/usr/local/lib/python2.7/test/test_dict.pyt_trackedLs  cCsdddgf\}}}}|jiƒ|jid|6||6d|6ƒ|jidd6dd6ƒ|jidd6tdttdf6ƒ|jitƒd6ƒ|jigd6ƒ|jigfd6ƒ|jiid6ƒ|jitƒd6ƒdS( Ngø?R"iiR#(iN(((R*RÇRRR RCRÈR%(RRFR|RRtw((s*/usr/local/lib/python2.7/test/test_dict.pyttest_track_literalsRs "'c CsHdtfd„ƒY}dddtƒfg|ƒf\}}}}}tƒ}|j|ƒd|d<|j|ƒd||<|j|ƒd||<|j|ƒ|j|jƒƒ||d<|j|ƒ|j|jƒƒd|d<|j|ƒ|j|jƒƒtƒ}tƒ}||d<|j|ƒ|j|ƒ||d<|j|ƒtj|||gƒ}|j|ƒtƒ}|j|ƒ|j|ƒtj||||gƒ}|j|ƒtƒ}|j|ƒ|j|ƒtd |d |d |ƒ}|j|ƒtd |d |d |d |ƒ}|j|ƒtƒ}|jd |d |d |ƒ|j|ƒ|jd |ƒ|j|ƒt||f|dfgƒ}|j|ƒt||f||fgƒ}|j|ƒtƒ}|j||f|dfgƒ|j|ƒ|j||f||fgƒ|j|ƒdS( NtMyObjectcBseZRS((R>R?(((s*/usr/local/lib/python2.7/test/test_dict.pyRËgsgø?R"iiiiRFR|RRRÉ(RCRRÇRlRÈR*RiRW( RRËRFR|RRRÉtoR+tdd((s*/usr/local/lib/python2.7/test/test_dict.pyttest_track_dynamicdsh0                            !        cCs*dtfd„ƒY}|j|ƒƒdS(NtMyDictcBseZRS((R>R?(((s*/usr/local/lib/python2.7/test/test_dict.pyRϧs(RRÈ(RRÏ((s*/usr/local/lib/python2.7/test/test_dict.pyttest_track_subtypes¤s(&R>R?RRR!R,R.R/R2R6R8RGRIRZRoRpRrRvR~R‹R‘R“R–RšR¦R§R²R³R¶R¸RÄRÇRÈRt cpython_onlyRÊRÎRÐ(((s*/usr/local/lib/python2.7/test/test_dict.pyRsD     &  L :     (    +        @(t mapping_teststGeneralMappingTestscBseZeZRS((R>R?Rt type2test(((s*/usr/local/lib/python2.7/test/test_dict.pyRÓ®stDictcBseZRS((R>R?(((s*/usr/local/lib/python2.7/test/test_dict.pyRÕ±stSubclassMappingTestscBseZeZRS((R>R?RÕRÔ(((s*/usr/local/lib/python2.7/test/test_dict.pyRÖ´scCs3tjdtfƒtjtttƒWdQXdS(Ns=dict(.has_key..| inequality comparisons) not supported in 3.x(Rtcheck_py3k_warningstDeprecationWarningt run_unittestRRÓRÖ(((s*/usr/local/lib/python2.7/test/test_dict.pyt test_main·s t__main__(tunittestttestRR_RRR¿R½tTestCaseRRÒtBasicTestMappingProtocolRÓRRÕRÖRÚR>(((s*/usr/local/lib/python2.7/test/test_dict.pyts $ÿÿ¦