ó ę=Nc@sddlZddlZddlZddlmZddlmZddlZejZ ddd„ƒYa dt fd„ƒYZ de fd „ƒYZ d e e fd „ƒYad dd „ƒYZdadejfd„ƒYZdejfd„ƒYZdS(i˙˙˙˙N(tunittest(trebuildtFoocBseZRS((t__name__t __module__(((s=/usr/lib/python2.7/dist-packages/twisted/test/test_rebuild.pyRstBarcBseZRS((RR(((s=/usr/lib/python2.7/dist-packages/twisted/test/test_rebuild.pyRstBazcBseZRS((RR(((s=/usr/lib/python2.7/dist-packages/twisted/test/test_rebuild.pyRstBuzcBseZRS((RR(((s=/usr/lib/python2.7/dist-packages/twisted/test/test_rebuild.pyRstHashRaisesRuntimeErrorcBs eZdZd„Zd„ZRS(sĄ Things that don't hash (raise an Exception) should be ignored by the rebuilder. @ivar hashCalled: C{bool} set to True when __hash__ is called. cCs t|_dS(N(tFalset hashCalled(tself((s=/usr/lib/python2.7/dist-packages/twisted/test/test_rebuild.pyt__init__scCst|_tdƒ‚dS(Nsnot a TypeError!(tTrueR t RuntimeError(R ((s=/usr/lib/python2.7/dist-packages/twisted/test/test_rebuild.pyt__hash__s (RRt__doc__R R(((s=/usr/lib/python2.7/dist-packages/twisted/test/test_rebuild.pyRs tRebuildTestCasecBsVeZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z RS( sH Simple testcase for rebuilding, to at least exercise the code. cCs‰|jƒ|_tj|jƒtjj|jdƒ|_tj|jƒttjj|jdƒdƒjƒt jj d|jƒdS(Nttwisted_rebuild_fakelibs __init__.pytwi( tmktemptlibPathtostmkdirtpathtjoint fakelibPathtfiletclosetsystinsert(R ((s=/usr/lib/python2.7/dist-packages/twisted/test/test_rebuild.pytsetUp+s %cCstjj|jƒdS(N(RRtremoveR(R ((s=/usr/lib/python2.7/dist-packages/twisted/test/test_rebuild.pyttearDown3sc Cs˝ddlm}ddl}ddl}|j|tdƒtjj|j dƒƒddl m }|j ƒ}yt Wntk rŠnHXddlm}|jƒ}d|jfd„ƒY}||_|ƒ} |jƒ} |j|jƒd ƒ|jd ƒ|j|td ƒtjj|j dƒƒtj|ƒyt Wntk rTn9X|jƒ} |j| jƒd ƒ|j|jƒd ƒ|j| jƒd ƒ|j|jƒdƒdS(Ni˙˙˙˙(tsibpathsmyrebuilder1.pysmyrebuilder.py(t myrebuilder(t test_rebuildtCcBseZRS((RR(((s=/usr/lib/python2.7/dist-packages/twisted/test/test_rebuild.pyR%Dstagš™™™™™ń?smyrebuilder2.pytctdtb(ttwisted.python.utilR"tshutilttimetcopyfilet__file__RRRRRR#tAtobjectt NameErrort twisted.testR$tBR%tInheritt assertEqualR&tsleepRR)( R R"R+R,R#R&R$R)R%R'titb2((s=/usr/lib/python2.7/dist-packages/twisted/test/test_rebuild.pyttestFileRebuild6s<          cCsYtjdƒ}tjtdtƒ|jƒ|j|jtjƒ|jttjƒdS(s1 Rebuilding an unchanged module. R&tdoLogN( tcrash_test_dummytXRR tdotfailUnlessIdenticalt __class__tftfoo(R tx((s=/usr/lib/python2.7/dist-packages/twisted/test/test_rebuild.pyt testRebuild^s  cCsŻtjƒ}|jtjtjƒ|jtjƒ}tjtdƒ|jtjƒ}|jƒ|j|j tjƒddl m }|j t |jtjtjtjƒdS(Nii˙˙˙˙(t components(R;t XComponentt setAdaptertIXtXAt getComponentRtmethodR5R?ttwisted.pythonRDtfailUnlessRaisest ValueErrortregisterAdapterR<(R RBt oldComponentt newComponentRD((s=/usr/lib/python2.7/dist-packages/twisted/test/test_rebuild.pyttestComponentInteractionos   cCs|tƒ}dd d„ƒYadttfd„ƒYatj|ƒt|dƒs]tdƒ‚t|dƒsxtdƒ‚dS( NRcBseZd„ZRS(cSsdS(N((R ((s=/usr/lib/python2.7/dist-packages/twisted/test/test_rebuild.pyRA†s(RRRA(((s=/usr/lib/python2.7/dist-packages/twisted/test/test_rebuild.pyR…sRcBseZdZRS(i (RRRB(((s=/usr/lib/python2.7/dist-packages/twisted/test/test_rebuild.pyRˆsRAs"Missing method on rebuilt instanceRBs+Missing class attribute on rebuilt instance((RRRRRtupdateInstancethasattrtAssertionError(R R)((s=/usr/lib/python2.7/dist-packages/twisted/test/test_rebuild.pyttestUpdateInstance€s   cCs4ddlm}ddlm}|j|jƒdS(Ni˙˙˙˙(R(tbanana(RKRttwisted.spreadRVt latestClasstBanana(R RRV((s=/usr/lib/python2.7/dist-packages/twisted/test/test_rebuild.pyttestBananaInteractionscCsCtƒad„}|j|ƒtjtƒ|jtjtƒdS(s~ Rebuilding something that has a __hash__ that raises a non-TypeError shouldn't cause rebuild to die. cSs dadS(N(tNonetunhashableObject(((s=/usr/lib/python2.7/dist-packages/twisted/test/test_rebuild.pyt_cleanupœsN(RR\t addCleanupRR5R R (R R]((s=/usr/lib/python2.7/dist-packages/twisted/test/test_rebuild.pyttest_hashException•s     ( RRRRR!R9RCRQRURZR_(((s=/usr/lib/python2.7/dist-packages/twisted/test/test_rebuild.pyR's   (    tNewStyleTestCasecBszeZdZd„Zd„Zd„Zejd krBde_nd„Z ejd krfde _nd „Z d „Z RS( sB Tests for rebuilding new-style classes of various sorts. cCs&tjdƒ|_|jtjds   ~