,Qc@spdZddlZddlmZmZddlmZmZedeZdefdYZ dZ dS( s jinja2.testsuite.debug ~~~~~~~~~~~~~~~~~~~~~~ Tests the debug system. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. iN(t JinjaTestCasetfilesystem_loader(t EnvironmenttTemplateSyntaxErrortloadert DebugTestCasecBs#eZdZdZdZRS(cs2fd}tjd|j|ddS(NcsjdddS(NtfailcSsddS(Nii((((s:/usr/lib/python2.7/site-packages/jinja2/testsuite/debug.pyts(trender((ttmpl(s:/usr/lib/python2.7/site-packages/jinja2/testsuite/debug.pyttestss broken.htmls File ".*?broken.html", line 2, in (top-level template code|) \{\{ fail\(\) \}\} File ".*?debug.pyc?", line \d+, in tmpl\.render\(fail=lambda: 1 / 0\) ZeroDivisionError: (int(eger)? )?division (or modulo )?by zero (tenvt get_templatetassert_traceback_matches(tselfR ((R s:/usr/lib/python2.7/site-packages/jinja2/testsuite/debug.pyttest_runtime_errors cCs|jdddS(NcSs tjdS(Nssyntaxerror.html(R R (((s:/usr/lib/python2.7/site-packages/jinja2/testsuite/debug.pyR'ss(?sm) File ".*?syntaxerror.html", line 4, in (template|) \{% endif %\}.*? (jinja2\.exceptions\.)?TemplateSyntaxError: Encountered unknown tag 'endif'. Jinja was looking for the following tags: 'endfor' or 'else'. The innermost block that needs to be closed is 'for'. (R (R((s:/usr/lib/python2.7/site-packages/jinja2/testsuite/debug.pyttest_syntax_error"s cCsd}|j|ddS(NcSstdddS(Ntwtfi*(R(((s:/usr/lib/python2.7/site-packages/jinja2/testsuite/debug.pyR .ss File ".*debug.pyc?", line \d+, in test raise TemplateSyntaxError\('wtf', 42\) (jinja2\.exceptions\.)?TemplateSyntaxError: wtf line 42(R (RR ((s:/usr/lib/python2.7/site-packages/jinja2/testsuite/debug.pyttest_regular_syntax_error-s  (t__name__t __module__RRR(((s:/usr/lib/python2.7/site-packages/jinja2/testsuite/debug.pyRs cCs&tj}|jtjt|S(N(tunittestt TestSuitetaddTestt makeSuiteR(tsuite((s:/usr/lib/python2.7/site-packages/jinja2/testsuite/debug.pyR7s ( t__doc__Rtjinja2.testsuiteRRtjinja2RRR RR(((s:/usr/lib/python2.7/site-packages/jinja2/testsuite/debug.pyt s  #