0Rc@s[dZddlZddlZddlZddlZddlmZddlmZddl m Z ej j ej j eZejidd6Zejdd Zejed Zejidd 6jZejeegZejied 6ed 6ZdejfdYZdZdej fdYZ!dZ"dZ#dS(s  jinja2.testsuite ~~~~~~~~~~~~~~~~ All the unittests of Jinja2. These tests can be executed by either running run-tests.py using multiple Python versions at the same time. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. iN(tformat_exception(tloaders(tPY2tFOOs justdict.htmlsjinja2.testsuite.rest templatess/res/templatessjustfunction.htmltatbt JinjaTestCasecBsGeZdZdZdZdZdZdZdZRS(cCsdS(N((tself((s=/usr/lib/python2.7/site-packages/jinja2/testsuite/__init__.pytsetup*scCsdS(N((R((s=/usr/lib/python2.7/site-packages/jinja2/testsuite/__init__.pytteardown-scCs|jdS(N(R (R((s=/usr/lib/python2.7/site-packages/jinja2/testsuite/__init__.pytsetUp0scCs|jdS(N(R (R((s=/usr/lib/python2.7/site-packages/jinja2/testsuite/__init__.pyttearDown3scCs|j||S(N(t assertEqual(RRR((s=/usr/lib/python2.7/site-packages/jinja2/testsuite/__init__.pyt assert_equal6scOs|j||S(N(t assertRaises(Rtargstkwargs((s=/usr/lib/python2.7/site-packages/jinja2/testsuite/__init__.pyt assert_raises9scCsy |Wnqtk r~}ttj}tj|jdj|dkr|j ddj||fqnX|j ddS(Nts)Traceback did not match: %s expected: %ssExpected exception( t ExceptionRtsystexc_infotretsearchtstriptjointNonetfail(Rtcallbackt expected_tbtettb((s=/usr/lib/python2.7/site-packages/jinja2/testsuite/__init__.pytassert_traceback_matches<s '  ( t__name__t __module__R R R R RRR!(((s=/usr/lib/python2.7/site-packages/jinja2/testsuite/__init__.pyR%s      ccsr|g}xb|rm|j}y|j|Wq tk ri|d|jj|jj|jffVq Xq WdS(s8Yields all the tests and their names from a given suite.s%s.%s.%sN(tpoptextendt TypeErrort __class__R#R"t_testMethodName(tsuitetsuitests((s=/usr/lib/python2.7/site-packages/jinja2/testsuite/__init__.pytfind_all_testsHs      t BetterLoadercBs#eZdZdZddZRS(s~A nicer loader that solves two problems. First of all we are setting up tests from different sources and we're doing this programmatically which breaks the default loading logic so this is required anyways. Secondly this loader has a nicer interpolation for test names than the default one so you can just do ``run-tests.py ViewTestCase`` and it will work. cCstS(N(R)(R((s=/usr/lib/python2.7/site-packages/jinja2/testsuite/__init__.pyt getRootSuite`sc Cs|j}|dkr|Sg}xpt|D]b\}}||ks|jd|sd|d|ks|j|dr/|j|q/q/W|std|nt|dkr|dStj}x|D]}|j |qW|S(NR)t.s!could not find test case for "%s"ii( R.R,tendswitht startswithtappendt LookupErrortlentunittestt TestSuitetaddTest( Rtnametmoduletroott all_teststtestcasettestnametrvttest((s=/usr/lib/python2.7/site-packages/jinja2/testsuite/__init__.pytloadTestsFromNamecs$     N(R"R#t__doc__R.RR@(((s=/usr/lib/python2.7/site-packages/jinja2/testsuite/__init__.pyR-Ws cCsddlm}m}m}m}m}m}m}m}m }m } m } m } m } m} m}tj}|j|j|j|j|j|j|j|j|j|j|j|j|j|j|j|j|j|j|j| j|j| j|j| j|j| j|j| jtr|j|jn|S(Ni(texttfiltersttestst core_tagstloadert inheritancetimportst lexnparsetsecuritytapit regressiontdebugtutilstbytecode_cachetdoctests(tjinja2.testsuiteRBRCRDRERFRGRHRIRJRKRLRMRNRORPR5R6R7R)R(RBRCRDRERFRGRHRIRJRKRLRMRNRORPR)((s=/usr/lib/python2.7/site-packages/jinja2/testsuite/__init__.pyR){s&d cCs@ytjdtddWntk r;}d|GHnXdS(s/Runs the testsuite as command line application.t testLoadert defaultTestR)s Error: %sN(R5tmainR-R(R((s=/usr/lib/python2.7/site-packages/jinja2/testsuite/__init__.pyRTs($RAtosRRR5t tracebackRtjinja2Rtjinja2._compatRtpathtdirnametabspatht__file__theret DictLoadert dict_loadert PackageLoadertpackage_loadertFileSystemLoadertfilesystem_loadertFunctionLoadertgettfunction_loadert ChoiceLoadert choice_loadert PrefixLoadert prefix_loadertTestCaseRR,t TestLoaderR-R)RT(((s=/usr/lib/python2.7/site-packages/jinja2/testsuite/__init__.pyt s,        # $