{fc@srddlZddlZddlZddlZddlZdejfdYZedkrnejndS(iNt TestDiscoverycBs}eZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d ZRS( 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*tcSs |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.pyR2scSs|dS(Ns module((R((s4/usr/lib64/python2.7/unittest/test/test_discovery.pyR8RcSs|dS(Ns tests((tmodule((s4/usr/lib64/python2.7/unittest/test/test_discovery.pyR9Rs/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.pyRIscstj_dS(N(R RR((R(s4/usr/lib64/python2.7/unittest/test/test_discovery.pyRLscstj_dS(N(R RR((R(s4/usr/lib64/python2.7/unittest/test/test_discovery.pyROst a_directoryttest_directoryttest_directory2cs jdS(Ni(R(R(R(s4/usr/lib64/python2.7/unittest/test/test_discovery.pyRTRcSstS(N(tTrue(R((s4/usr/lib64/python2.7/unittest/test/test_discovery.pyRWRcstjj|kS(N(R Rtbasename(R(t directories(s4/usr/lib64/python2.7/unittest/test/test_discovery.pyRZRtModulecBs,eZgZgZdZdZdZRS(csP|_jj|tjj|dkrLfd}|_ndS(NR1csjj|||fdS(Nt load_tests(tload_tests_argstappend(R tteststpattern(R (s4/usr/lib64/python2.7/unittest/test/test_discovery.pyR7es(RtpathsR9R R4R7(R RR7((R s4/usr/lib64/python2.7/unittest/test/test_discovery.pyt__init__as  cSs|j|jkS(N(R(R tother((s4/usr/lib64/python2.7/unittest/test/test_discovery.pyt__eq__jsN(t__name__t __module__R<R8R=R?tNonet__hash__(((s4/usr/lib64/python2.7/unittest/test/test_discovery.pyR6]s  cs |S(N((R (R6(s4/usr/lib64/python2.7/unittest/test/test_discovery.pyRpRcs#|rjdn|jdS(Ns+use_load_tests should be False for packagess module tests(tfailureExceptionR(R tuse_load_tests(R (s4/usr/lib64/python2.7/unittest/test/test_discovery.pyR'qss/foostest*R7s module tests(RRR RRRRR%tobjectR&R'RR)R*RR<R8(R R RRRR'R-((R6R5RRRRR s4/usr/lib64/python2.7/unittest/test/test_discovery.pyttest_find_tests_with_packageEs4           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.pyRRcstj(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(R3(R((s4/usr/lib64/python2.7/unittest/test/test_discovery.pyRRcSstS(N(R3(R((s4/usr/lib64/python2.7/unittest/test/test_discovery.pyRRcstj_dS(N(R RR((R(s4/usr/lib64/python2.7/unittest/test/test_discovery.pyRscsj||fdgS(NR:(R9(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%RIR(tnormpathRt ImportErrortdiscoverRRtassertInR*tstrt suiteClass( R R RRKt full_pathRR*R-RLRM((RNRJRRs4/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.pyRRcSstS(N(R3(RW((s4/usr/lib64/python2.7/unittest/test/test_discovery.pyRRcs#tj_t_tj(dS(N(R RRRRI((RRRJ(s4/usr/lib64/python2.7/unittest/test/test_discovery.pytrestores  t.ii(RRR RRRRIR%RQRRtgetcwdRtcountTestCasesR)RRPttest_this_does_not_exist(R R RXR-ttest((RRRJs4/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 somethingRQtfootbar(RFt__new__Rt TestProgramt _do_discoveryt parseArgsR(R tprogramRa((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@RA(((s4/usr/lib64/python2.7/unittest/test/test_discovery.pyRkscs dS(N(((Rk(s4/usr/lib64/python2.7/unittest/test/test_discovery.pyt usageExitstonettwotthreetfour( t ExceptionRFReRRfRlRBt testLoaderRRg(R RlRi((Rks4/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(NR:(R`R9(R RMR;RL((s4/usr/lib64/python2.7/unittest/test/test_discovery.pyRQs(R@RAR`RQ(((s4/usr/lib64/python2.7/unittest/test/test_discovery.pyRtss-vRYstest*.py(RYstest*.pyN( RFReRRfRrRgRR`RB(R RiRt((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(NRtcBseZgZdZRS(cSs|jj|||fdS(NR:(R`R9(R RMR;RL((s4/usr/lib64/python2.7/unittest/test/test_discovery.pyRQs(R@RAR`RQ(((s4/usr/lib64/python2.7/unittest/test/test_discovery.pyRtss-viR:RYstest*.pys --verbosetfishteggsthams-ss-ts-ps-fs-c(RYstest*.pyN(RYstest*.pyN(RYstest*.pyN(Rvstest*.pyN(RvRwN(RvRwRx(Rvstest*.pyN(RYstest*.pyRv(RYRvN(RvRwN(RFReRRfRgRt verbosityR]R`RBt assertFalsetfailfastt catchbreakt assertTrue(R RiRt((s4/usr/lib64/python2.7/unittest/test/test_discovery.pyt4test_command_line_handling_do_discovery_calls_loadersr         !csdtfdY}|tjds           cCs|j}tj}tjjd}tjjd}tjd||f}|jt d||j dddd|j t jd|dS( NRdRcsZ'foo' module incorrectly imported from %r. Expected %r. Is this module globally installed?s^%s$RMR;sfoo.pyi( RRRR RR(tretescapetassertRaisesRegexpRPRQRRI(R RUR tmod_dirt expected_dirtmsg((s4/usr/lib64/python2.7/unittest/test/test_discovery.pyttest_detect_module_clash[s    cs|j}tjjtjjdtjjdfd}|j|fd}|tj_tj}|jdddddS(NRdRccstj_dS(N(R Rtrealpath((toriginal_realpath(s4/usr/lib64/python2.7/unittest/test/test_discovery.pyRqscs2|tjjdkr.tjjdS|S(Nsfoo.py(R Rtjoin(R(RR(s4/usr/lib64/python2.7/unittest/test/test_discovery.pyRusRMR;sfoo.py( RR RRR(R%RRRQ(R RURRR ((RRRs4/usr/lib64/python2.7/unittest/test/test_discovery.pyttest_module_symlink_okis     cstj}gtjjtjjtjjt_ fd}||_ |j d}j j j |jdS(Ncst_j|S(N(R3twasRunR(RMR;(t expectedPathR R:(s4/usr/lib64/python2.7/unittest/test/test_discovery.pyR*s s unittest.test(RRR RR(tdirnameR]RRHRR*RQR}Rt_tests(R R R*R-((RR R:s4/usr/lib64/python2.7/unittest/test/test_discovery.pyttest_discovery_from_dotted_path}s  $  (R@RAR R/RGRVR^RjRsRuR~RRRR(((s4/usr/lib64/python2.7/unittest/test/test_discovery.pyR s  + A .    J   t__main__( R RRIRt unittest.testtTestCaseRR@tmain(((s4/usr/lib64/python2.7/unittest/test/test_discovery.pyts