^Rc@sddlmZddlZddlZddlZdejfdYZdejfdYZe Z de fdYZ d ejfd YZ e d krejndS( i(tStringIONtTest_TestProgramcBsgeZdZdZdejfdYZdejfdYZdZ dZ dZ RS( cstj}gtjjtjjtjjt_ fd}||_ |j d}j j j |jdS(Ncst_j|S(N(tTruetwasRunt assertEqual(t start_dirtpattern(t expectedPathtselfttests(s0/usr/lib/python2.7/unittest/test/test_program.pyt _find_testss s unittest.test(tunittestt TestLoadertostpathtabspathtdirnamettestt__file__tFalseRR tdiscovert assertTrueRt_tests(RtloaderR tsuite((RRR s0/usr/lib/python2.7/unittest/test/test_program.pyttest_discovery_from_dotted_path s  $  cstt}dtffdY}|}tjjfd}dtj_|j|d}|tj_|j|tjd|dtdd }|j|j|j|j||j|j d dS( Nt FakeRunnercseZfdZRS(cs ||_S(N(R(RR(tresult(s0/usr/lib/python2.7/unittest/test/test_program.pytrun s (t__name__t __module__R((R(s0/usr/lib/python2.7/unittest/test/test_program.pyRscstj_dS(N(R t TestProgramt parseArgs((t oldParseArgs(s0/usr/lib/python2.7/unittest/test/test_program.pytrestoreParseArgs'scWsdS(N(tNone(targs((s0/usr/lib/python2.7/unittest/test/test_program.pyt)scSs tj`dS(N(R RR(((s0/usr/lib/python2.7/unittest/test/test_program.pyt removeTest,st testRunnertexitt verbosityi( tobjectR RR t addCleanupRRRRR)(RRRtrunnerR"R&tprogram((R!Rs0/usr/lib/python2.7/unittest/test/test_program.pyt testNoExits        tFooBarcBseZdZdZRS(cCsdS(N((R((s0/usr/lib/python2.7/unittest/test/test_program.pyttestPass8scCsdS(N((R((s0/usr/lib/python2.7/unittest/test/test_program.pyttestFail:s(RRR0R1(((s0/usr/lib/python2.7/unittest/test/test_program.pyR/7s t FooBarLoadercBseZdZdZRS(s3Test loader that returns a suite containing FooBar.cCs|j|jtjgS(N(t suiteClasstloadTestsFromTestCaseRR/(Rtmodule((s0/usr/lib/python2.7/unittest/test/test_program.pytloadTestsFromModule?s(RRt__doc__R6(((s0/usr/lib/python2.7/unittest/test/test_program.pyR2=sc CsVtjdtddgdtjdtd|j}|jt|ddS(NR(targvtfoobarR'tstreamt testLoaderR(R tmainRtTextTestRunnerRR2Rthasattr(RR-((s0/usr/lib/python2.7/unittest/test/test_program.pyt test_NonExitDs  c CsG|jttjddgdtjdtdtd|jdS(NR8R9R'R:R(R;(t assertRaisest SystemExitR R<R=RRR2(R((s0/usr/lib/python2.7/unittest/test/test_program.pyt test_ExitLs  c CsA|jttjddgdtjdtd|jdS(NR8R9R'R:R;(R@RAR R<R=RR2(R((s0/usr/lib/python2.7/unittest/test/test_program.pyttest_ExitAsDefaultVs   ( RRRR.R tTestCaseR/R R2R?RBRC(((s0/usr/lib/python2.7/unittest/test/test_program.pyRs    tInitialisableProgramcBsDeZeZdZdZdZdZe j Z dZ dZ dZRS(iRcGsdS(N((RR$((s0/usr/lib/python2.7/unittest/test/test_program.pyt__init__hsN(RRRR(R#RR)t defaultTestR'R tdefaultTestLoaderR;tprogNameRRF(((s0/usr/lib/python2.7/unittest/test/test_program.pyRE_s RcBs,eZdZdZeZdZdZRS(cKs(|t_tjr$tt_tndS(N(RtinitArgst raiseErrorRt TypeError(Rtkwargs((s0/usr/lib/python2.7/unittest/test/test_program.pyRFrs   cCs |t_tS(N(RRtRESULT(RR((s0/usr/lib/python2.7/unittest/test/test_program.pyRxs N( RRR#RJRRRKRFR(((s0/usr/lib/python2.7/unittest/test/test_program.pyRms  tTestCommandLineArgscBsPeZdZdZdZdZdZdZdZdZ RS(cCs:t|_d|j_dt_dt_tt_dS(NcSsdS(N(R#(((s0/usr/lib/python2.7/unittest/test/test_program.pyR%s( RER-t createTestsR#RRJRRRK(R((s0/usr/lib/python2.7/unittest/test/test_program.pytsetUp~s    cs|jdfd}|_xJdD]B}t_jd|g|jj|jjq+Wjddg|jj|j jdS(Ncs|_t_dS(N(tmsgRR((RR(R-(s0/usr/lib/python2.7/unittest/test/test_program.pyt usageExits s-hs-Hs--helps-$(s-hs-Hs--help( R-R#RSRR(R Rt assertIsNoneRRtassertIsNotNone(RRStopt((R-s0/usr/lib/python2.7/unittest/test/test_program.pyttestHelpAndUnknowns    cCs|j}x=dD]5}d|_|jd|g|j|jdqWx=d D]5}d|_|jd|g|j|jdqPWdS( Ns-qs--quietiis-vs --verbosei(s-qs--quiet(s-vs --verbose(R-R)R R#R(RR-RV((s0/usr/lib/python2.7/unittest/test/test_program.pyt testVerbositys     cCs |j}xdd d fD]\}}|dkr>t r>qnd|d}d|}xM||fD]?}t||d|jd|g|jt||qcWxY||fD]K}t}t||||jd|g|jt|||qWqWdS( Ntbuffertfailfasttcatcht catchbreaks-%sis--%s(sbuffersbuffer(sfailfastsfailfast(R[s catchbreak( R-thasInstallHandlertsetattrR#R RtgetattrR*R(RR-targtattrt short_opttlong_optRVtnot_none((s0/usr/lib/python2.7/unittest/test/test_program.pyttestBufferCatchFailfasts     cCs|j}t|_d|_d|_d|_|j|jtjidd6dd6dd6|jtj d|j |j t dS(NR)RZRYR( R-RR'R)RZRYtrunTestsRRJRtassertIsRRN(RR-((s0/usr/lib/python2.7/unittest/test/test_program.pyttestRunTestsRunnerClasss       cCsb|j}t|_dt_|j|jtj|jtjd|j |j t dS(NR( R-RR'R#RJRfRTRRRgRRN(RR-((s0/usr/lib/python2.7/unittest/test/test_program.pyttestRunTestsRunnerInstances    cCs|j}tt_t|_d|_d|_d|_d|_|j |j tj i|j tjd|j |j tdS(NR)RZRYR(R-RRRKR'R)RZRYRRfRRJRgRRN(RR-((s0/usr/lib/python2.7/unittest/test/test_program.pyttestRunTestsOldRunnerClasss        cstjdjfd}j|t_fd}|_j}t|_t |_ |j j jdS(Ns unittest.maincs _dS(N(tinstallHandler((R5toriginal(s0/usr/lib/python2.7/unittest/test/test_program.pytrestorescs t_dS(N(Rt installed((R(s0/usr/lib/python2.7/unittest/test/test_program.pytfakeInstallHandlers( tsystmodulesRkR+RRnR-RR\RR'RfR(RRmRoR-((R5RlRs0/usr/lib/python2.7/unittest/test/test_program.pyttestCatchBreakInstallsHandlers         ( RRRQRWRXReRhRiRjRr(((s0/usr/lib/python2.7/unittest/test/test_program.pyRO|s      t__main__(t cStringIORR RpR RDRRRER*RNRRORR<(((s0/usr/lib/python2.7/unittest/test/test_program.pyts   W