rfc@sdZddlZddlmZddlmZeZdZdefdYZ de fd YZ d efd YZ d Z d efdYZ dS(t TestSuiteiNi(tcase(tutilcCs t||d}|dS(NcSsdS(N(tNone(((s&/usr/lib64/python2.7/unittest/suite.pyt s(tgetattr(tparenttattrtfunc((s&/usr/lib64/python2.7/unittest/suite.pyt_call_if_exists st BaseTestSuitecBszeZdZd dZdZdZdZd ZdZ dZ dZ dZ d Z d Zd ZRS(sNA simple test suite that doesn't provide class or module shared fixtures. cCsg|_|j|dS(N(t_teststaddTests(tselfttests((s&/usr/lib64/python2.7/unittest/suite.pyt__init__s cCs dtj|jt|fS(Ns <%s tests=%s>(Rtstrclasst __class__tlist(R ((s&/usr/lib64/python2.7/unittest/suite.pyt__repr__scCs,t||jstSt|t|kS(N(t isinstanceRtNotImplementedR(R tother((s&/usr/lib64/python2.7/unittest/suite.pyt__eq__scCs ||k S(N((R R((s&/usr/lib64/python2.7/unittest/suite.pyt__ne__scCs t|jS(N(titerR (R ((s&/usr/lib64/python2.7/unittest/suite.pyt__iter__%scCs+d}x|D]}||j7}q W|S(Ni(tcountTestCases(R tcasesttest((s&/usr/lib64/python2.7/unittest/suite.pyR(s cCswt|ds-tdjt|nt|trct|tjt frctdn|j j |dS(Nt__call__s{} is not callablesNTestCases and TestSuites must be instantiated before passing them to addTest()( thasattrt TypeErrortformattreprRttypet issubclassRtTestCaseRR tappend(R R((s&/usr/lib64/python2.7/unittest/suite.pytaddTest.s cCs@t|trtdnx|D]}|j|q%WdS(Ns0tests must be an iterable of tests, not a string(Rt basestringR R'(R RR((s&/usr/lib64/python2.7/unittest/suite.pyR 8s cCs,x%|D]}|jrPn||qW|S(N(t shouldStop(R tresultR((s&/usr/lib64/python2.7/unittest/suite.pytrun>s   cOs|j||S(N(R+(R targstkwds((s&/usr/lib64/python2.7/unittest/suite.pyREscCsx|D]}|jqWdS(s7Run the tests without collecting errors in a TestResultN(tdebug(R R((s&/usr/lib64/python2.7/unittest/suite.pyR.Hs (N(t__name__t __module__t__doc__RRRRRt__hash__RRR'R R+RR.(((s&/usr/lib64/python2.7/unittest/suite.pyR s         cBsYeZdZedZdZdZdZdZdZ dZ dZ RS( sA test suite is a composite test consisting of a number of TestCases. For use, create an instance of TestSuite, then add test case instances. When all tests have been added, the suite can be passed to a test runner, such as TextTestRunner. It will run the individual test cases in the order in which they were added, aggregating the results. When subclassing, do not forget to call the base class constructor. cCst}t|dttkr.t|_}nx|D]}|jrHPnt|r|j|||j|||j|||j |_ t|j dts5t|dtrq5qn|s||q5|j q5W|r|jd||j |t|_n|S(Nt_testRunEnteredt_classSetupFailedt_moduleSetUpFailed(tFalseRtTrueR3R)t _isnotsuitet_tearDownPreviousClasst_handleModuleFixturet_handleClassSetUpRt_previousTestClassR.Rt_handleModuleTearDown(R R*R.ttopLevelR((s&/usr/lib64/python2.7/unittest/suite.pyR+Xs,        cCst}|j|tdS(s7Run the tests without collecting errors in a TestResultN(t _DebugResultR+R7(R R.((s&/usr/lib64/python2.7/unittest/suite.pyR.vs c Cs!t|dd}|j}||kr+dS|jr8dSt|dtrNdSy t|_Wntk rnnXt|dd}|dk rt|dzoy |Wn]tk r}t |t rnt |_t j |}d|}|j|||nXWdt|dXndS(NR<t__unittest_skip__t setUpClasst _setupStdoutssetUpClass (%s)t_restoreStdout(RRRR5R6R4R R t ExceptionRR?R7RRt_addClassOrModuleLevelException( R RR*t previousClasst currentClassRAtet classNamet errorName((s&/usr/lib64/python2.7/unittest/suite.pyR;}s4          cCs4d}t|dd}|dk r0|j}n|S(NR<(RRR0(R R*tpreviousModuleRF((s&/usr/lib64/python2.7/unittest/suite.pyt_get_previous_modules   c Cs |j|}|jj}||kr+dS|j|t|_ytj|}Wntk rfdSXt |dd}|dk rt |dz`y |WnNt k r}t |trnt|_d|}|j|||nXWdt |dXndS(Nt setUpModuleRBssetUpModule (%s)RC(RLRR0R=R6R5tsystmodulestKeyErrorRRR RDRR?R7RE( R RR*RKt currentModuletmoduleRMRHRJ((s&/usr/lib64/python2.7/unittest/suite.pyR:s.          cCslt|}t|dd}|dk rRt|tjrR||t|n|j|tj dS(NtaddSkip( t _ErrorHolderRRRRtSkipTesttstrtaddErrorRNtexc_info(R R*t exceptionRJterrorRS((s&/usr/lib64/python2.7/unittest/suite.pyREs  cCs|j|}|dkrdS|jr,dSytj|}Wntk rQdSXt|dd}|dk rt|dzWy |WnEtk r}t |t rnd|}|j |||nXWdt|dXndS(NttearDownModuleRBstearDownModule (%s)RC( RLRR5RNRORPRR RDRR?RE(R R*RKRRR[RHRJ((s&/usr/lib64/python2.7/unittest/suite.pyR=s*       c Cst|dd}|j}||kr+dSt|dtrAdSt|dtrWdSt|dtrmdSt|dd}|dk rt|dzfy |WnTtk r}t|trntj |}d|}|j |||nXWdt|dXndS( NR<R4R5R@t tearDownClassRBstearDownClass (%s)RC( RRRR6R RDRR?RRRE( R RR*RFRGR\RHRIRJ((s&/usr/lib64/python2.7/unittest/suite.pyR9s.      ( R/R0R1R6R+R.R;RLR:RER=R9(((s&/usr/lib64/python2.7/unittest/suite.pyRNs      RTcBs\eZdZd ZdZdZdZdZdZ dZ dZ dZ RS( s Placeholder for a TestCase inside a result. As far as a TestResult is concerned, this looks exactly like a unit test. Used to insert arbitrary errors into a test suite run. cCs ||_dS(N(t description(R R]((s&/usr/lib64/python2.7/unittest/suite.pyRscCs|jS(N(R](R ((s&/usr/lib64/python2.7/unittest/suite.pytid scCsdS(N(R(R ((s&/usr/lib64/python2.7/unittest/suite.pytshortDescriptionscCsd|jfS(Ns(R](R ((s&/usr/lib64/python2.7/unittest/suite.pyRscCs |jS(N(R^(R ((s&/usr/lib64/python2.7/unittest/suite.pyt__str__scCsdS(N((R R*((s&/usr/lib64/python2.7/unittest/suite.pyR+scCs |j|S(N(R+(R R*((s&/usr/lib64/python2.7/unittest/suite.pyRscCsdS(Ni((R ((s&/usr/lib64/python2.7/unittest/suite.pyRsN( R/R0R1RtfailureExceptionRR^R_RR`R+RR(((s&/usr/lib64/python2.7/unittest/suite.pyRTs       cCs'yt|Wntk r"tSXtS(s?A crude way to tell apart testcases and suites with duck-typing(RR R7R6(R((s&/usr/lib64/python2.7/unittest/suite.pyR8"s  R?cBs eZdZdZeZeZRS(sCUsed by the TestSuite to hold previous class when running in debug.N(R/R0R1RR<R6R5R)(((s&/usr/lib64/python2.7/unittest/suite.pyR?+s(R1RNtRRR7t __unittestR tobjectR RRTR8R?(((s&/usr/lib64/python2.7/unittest/suite.pyts  >&