rfc@sfddlZddlZddlZddlZdejfdYZedkrbejndS(iNt TestDiscoverycBskeZdZdZdZdZdZdZdZdZ dZ d Z d Z RS( cCsetj}d|_|jd}|j|dts>dS|jt|jdWdQXdS(Ns/foos/foo/bar/baz.pysbar.bazs /bar/baz.py(tunittestt TestLoadert_top_level_dirt_get_name_from_patht assertEqualt __debug__t assertRaisestAssertionError(tselftloadertname((s4/usr/lib64/python2.7/unittest/test/test_discovery.pyttest_get_name_from_path s  c stj}tjfd}tjjfd}tjjfd}dddddd d gd d ggfd t_|j|d}|tj_|j|d}|tj_|j|d|_d|_ tjj d}||_ t |j |d}gdD]} | d^q6} | jgdD]} d| d^qY|j|| dS(Ncs t_dS(N(tostlistdir((toriginal_listdir(s4/usr/lib64/python2.7/unittest/test/test_discovery.pytrestore_listdirscstj_dS(N(R tpathtisfile((toriginal_isfile(s4/usr/lib64/python2.7/unittest/test/test_discovery.pytrestore_isfile scstj_dS(N(R Rtisdir((toriginal_isdir(s4/usr/lib64/python2.7/unittest/test/test_discovery.pyt restore_isdir#sstest1.pystest2.pys not_a_test.pyttest_dirstest.foostest-not-a-module.pyt another_dirstest3.pystest4.pycs jdS(Ni(tpop(R(t path_lists(s4/usr/lib64/python2.7/unittest/test/test_discovery.pyt)scSs |jdS(Ntdir(tendswith(R((s4/usr/lib64/python2.7/unittest/test/test_discovery.pyR,scSs|jd od|kS(NRR(R(R((s4/usr/lib64/python2.7/unittest/test/test_discovery.pyR1scSs|dS(Ns module((R((s4/usr/lib64/python2.7/unittest/test/test_discovery.pyR7scSs|dS(Ns tests((tmodule((s4/usr/lib64/python2.7/unittest/test/test_discovery.pyR8ss/foostest*.pyttest1ttest2s module teststtest3ttest4s test_dir.%s(R R!(R"R#(RRR RRRRt addCleanupt_get_module_from_nametloadTestsFromModuletabspathRtlistt _find_teststextendR( R R RRRRRt top_leveltsuiteR texpected((RRRRs4/usr/lib64/python2.7/unittest/test/test_discovery.pyttest_find_testss8                 cstj}tjfd}tjjfd}tjjfd}dddgggggfdt_j|dtj_j|fd tj_j|d tfd Yfd |_ fd }||_ d|_ t |j dd}j|dddgjjddgjj|dddfgdS(Ncs t_dS(N(R R((R(s4/usr/lib64/python2.7/unittest/test/test_discovery.pyRHscstj_dS(N(R RR((R(s4/usr/lib64/python2.7/unittest/test/test_discovery.pyRKscstj_dS(N(R RR((R(s4/usr/lib64/python2.7/unittest/test/test_discovery.pyRNst a_directoryttest_directoryttest_directory2cs jdS(Ni(R(R(R(s4/usr/lib64/python2.7/unittest/test/test_discovery.pyRSscSstS(N(tTrue(R((s4/usr/lib64/python2.7/unittest/test/test_discovery.pyRVscstjj|kS(N(R Rtbasename(R(t directories(s4/usr/lib64/python2.7/unittest/test/test_discovery.pyRYstModulecBs,eZgZgZdZdZdZRS(csP|_jj|tjj|dkrLfd}|_ndS(NR0csjj|||fdS(Nt load_tests(tload_tests_argstappend(R tteststpattern(R (s4/usr/lib64/python2.7/unittest/test/test_discovery.pyR6ds(RtpathsR8R R3R6(R RR6((R s4/usr/lib64/python2.7/unittest/test/test_discovery.pyt__init__`s  cSs|j|jkS(N(R(R tother((s4/usr/lib64/python2.7/unittest/test/test_discovery.pyt__eq__isN(t__name__t __module__R;R7R<R>tNonet__hash__(((s4/usr/lib64/python2.7/unittest/test/test_discovery.pyR5\s  cs |S(N((R (R5(s4/usr/lib64/python2.7/unittest/test/test_discovery.pyRoscs#|rjdn|jdS(Ns+use_load_tests should be False for packagess module tests(tfailureExceptionR(Rtuse_load_tests(R (s4/usr/lib64/python2.7/unittest/test/test_discovery.pyR&pss/foostest*R6s module tests(RRR RRRRR$tobjectR%R&RR(R)RR;R7(R R RRRR&R,((R5R4RRRRR s4/usr/lib64/python2.7/unittest/test/test_discovery.pyttest_find_tests_with_packageDs4           c stj}tjjtjjfd}dtj_|j|tjfd}|j|tjjtjj d}|j t |j dddWdQX|j |j||j|tjdtj_dtj_fd }|j|gfd }||_t|_|j d d d}tjjd}tjjd } |j |d |j |j||j | d fg|j|tjdS(Ncstj_dS(N(R RR((R(s4/usr/lib64/python2.7/unittest/test/test_discovery.pyRscSstS(N(tFalse(R((s4/usr/lib64/python2.7/unittest/test/test_discovery.pyRscstj(dS(N(tsysR((t orig_sys_path(s4/usr/lib64/python2.7/unittest/test/test_discovery.pyt restore_pathss/foos/foo/bart top_level_dircSstS(N(R2(R((s4/usr/lib64/python2.7/unittest/test/test_discovery.pyRscSstS(N(R2(R((s4/usr/lib64/python2.7/unittest/test/test_discovery.pyRscstj_dS(N(R RR((R(s4/usr/lib64/python2.7/unittest/test/test_discovery.pyRscsj||fdgS(NR9(R8(t start_dirR:(t_find_tests_args(s4/usr/lib64/python2.7/unittest/test/test_discovery.pyR)ss /foo/bar/bazR:s ['tests'](RRR RRRR$RHR'tnormpathRt ImportErrortdiscoverRRtassertInR)tstrt suiteClass( R R RRJt full_pathRR)R,RKRL((RMRIRRs4/usr/lib64/python2.7/unittest/test/test_discovery.pyt test_discovers:         cstj}tjdt_tjjdtj_tjfd}|j||jd}|j tj tj|j |j dt t |dd}|jt|jWdQXdS(NcSsdgS(Nstest_this_does_not_exist.py((t_((s4/usr/lib64/python2.7/unittest/test/test_discovery.pyRscSstS(N(R2(RV((s4/usr/lib64/python2.7/unittest/test/test_discovery.pyRscs#tj_t_tj(dS(N(R RRRRH((RRRI(s4/usr/lib64/python2.7/unittest/test/test_discovery.pytrestores  t.ii(RRR RRRRHR$RPRQtgetcwdRtcountTestCasesR(RROttest_this_does_not_exist(R R RWR,ttest((RRRIs4/usr/lib64/python2.7/unittest/test/test_discovery.pyt.test_discover_with_modules_that_fail_to_imports      cstjtj}gfd}||_|jddg|jg|jddddg|jddgdS(Ncsj|dS(N(R*(targv(targs(s4/usr/lib64/python2.7/unittest/test/test_discovery.pyt do_discoveryst somethingRPtfootbar(REt__new__Rt TestProgramt _do_discoveryt parseArgsR(R tprogramR`((R_s4/usr/lib64/python2.7/unittest/test/test_discovery.pyt$test_command_line_handling_parseArgss c s|dtfdYfd}tjtj}||_d|_|j|j ddddgWdQXdS(NtStopcBseZRS((R?R@(((s4/usr/lib64/python2.7/unittest/test/test_discovery.pyRjscs dS(N(((Rj(s4/usr/lib64/python2.7/unittest/test/test_discovery.pyt usageExitstonettwotthreetfour( t ExceptionRERdRReRkRAt testLoaderRRf(R RkRh((Rjs4/usr/lib64/python2.7/unittest/test/test_discovery.pyt:test_command_line_handling_do_discovery_too_many_argumentss  cCs^tjtj}dtfdY}||_|jdg|j|jdgdS(NtLoadercBseZgZdZRS(cSs|jj|||fdS(NR9(R_R8(R RLR:RK((s4/usr/lib64/python2.7/unittest/test/test_discovery.pyRPs(R?R@R_RP(((s4/usr/lib64/python2.7/unittest/test/test_discovery.pyRsss-vRXstest*.py(RXstest*.pyN( RERdRReRqRfRR_RA(R RhRs((s4/usr/lib64/python2.7/unittest/test/test_discovery.pyt;test_command_line_handling_do_discovery_uses_default_loaders  cCstjtj}dtfdY}|jdgd||j|jd|j|jd|j|jdgg|_tjtj}|jdgd||j|jd|j|jdgg|_tjtj}|jgd||j|jd|j|jdgg|_tjtj}|jd gd||j|jd|j|jdgg|_tjtj}|jd d gd||j|jd|j|jdgg|_tjtj}|jd d d gd||j|jd|j|jdgg|_tjtj}|jd d gd||j|jd|j|jdgg|_tjtj}|jd d gd||j|jd|j|jdgg|_tjtj}|jdd gd||j|jd|j|jdg|j |j |j |j g|_tjtj}|jdd d d dddgd||j|jd|j|jdg|j|jd|j |j |j |j dS(NRscBseZgZdZRS(cSs|jj|||fdS(NR9(R_R8(R RLR:RK((s4/usr/lib64/python2.7/unittest/test/test_discovery.pyRPs(R?R@R_RP(((s4/usr/lib64/python2.7/unittest/test/test_discovery.pyRsss-viR9RXstest*.pys --verbosetfishteggsthams-ss-ts-ps-fs-c(RXstest*.pyN(RXstest*.pyN(RXstest*.pyN(Rustest*.pyN(RuRvN(RuRvRw(Rustest*.pyN(RXstest*.pyRu(RXRuN(RuRvN(RERdRReRfRt verbosityR\R_RAt assertFalsetfailfastt catchbreakt assertTrue(R RhRs((s4/usr/lib64/python2.7/unittest/test/test_discovery.pyt4test_command_line_handling_do_discovery_calls_loadersr         !c sAdtfdY}|tjdsRbcsQt_tj_tj_tjd=tjkrMtjjndS(NRb(R RRRRRHtmodulestremove((RTRRR(s4/usr/lib64/python2.7/unittest/test/test_discovery.pytcleanupFs     cSsdgS(Nsfoo.py((RV((s4/usr/lib64/python2.7/unittest/test/test_discovery.pyROscSstS(N(R2(RV((s4/usr/lib64/python2.7/unittest/test/test_discovery.pyRQscSstS(N(R2(RV((s4/usr/lib64/python2.7/unittest/test/test_discovery.pyRSsRcsZ'foo' module incorrectly imported from %r. Expected %r. Is this module globally installed?s^%s$RLR:sfoo.pyi(RERHRR RR'RRRR$RRtretescapetassertRaisesRegexpRORPR( R R5RRRRR tmod_dirt expected_dirtmsg((RTRRRs4/usr/lib64/python2.7/unittest/test/test_discovery.pyttest_detect_module_clash=s.              cstj}gtjjtjjtjjt_ fd}||_ |j d}j j j |jdS(Ncst_j|S(N(R2twasRunR(RLR:(t expectedPathR R9(s4/usr/lib64/python2.7/unittest/test/test_discovery.pyR)ms s unittest.test(RRR RR'tdirnameR\R~RGRR)RPR|Rt_tests(R R R)R,((RR R9s4/usr/lib64/python2.7/unittest/test/test_discovery.pyttest_discovery_from_dotted_pathfs  $  ( R?R@R R.RFRUR]RiRrRtR}RR(((s4/usr/lib64/python2.7/unittest/test/test_discovery.pyRs  + A .    J )t__main__(R RRHRtTestCaseRR?tmain(((s4/usr/lib64/python2.7/unittest/test/test_discovery.pyts    p