ó
 `¾Tc           @   sp   d  Z  d d l Z d d l m Z m Z d d l m Z m Z e d e ƒ Z d e f d „  ƒ  YZ	 d „  Z
 d S(	   s²   
    jinja2.testsuite.debug
    ~~~~~~~~~~~~~~~~~~~~~~

    Tests the debug system.

    :copyright: (c) 2010 by the Jinja Team.
    :license: BSD, see LICENSE for more details.
iÿÿÿÿN(   t   JinjaTestCaset   filesystem_loader(   t   Environmentt   TemplateSyntaxErrort   loadert   DebugTestCasec           B   s#   e  Z d  „  Z d „  Z d „  Z RS(   c            s2   ‡  f d †  } t  j d ƒ ‰  |  j | d ƒ d  S(   Nc              s   ˆ  j  d d „  ƒ d  S(   Nt   failc           S   s   d d S(   Ni   i    (    (    (    (    s\   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/testsuite/debug.pyt   <lambda>   s    (   t   render(    (   t   tmpl(    s\   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/testsuite/debug.pyt   test   s    s   broken.htmlsó   
  File ".*?broken.html", line 2, in (top-level template code|<module>)
    \{\{ fail\(\) \}\}
  File ".*?debug.pyc?", line \d+, in <lambda>
    tmpl\.render\(fail=lambda: 1 / 0\)
ZeroDivisionError: (int(eger)? )?division (or modulo )?by zero
(   t   envt   get_templatet   assert_traceback_matches(   t   selfR
   (    (   R	   s\   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/testsuite/debug.pyt   test_runtime_error   s    	c         C   s   |  j  d „  d ƒ d  S(   Nc           S   s   t  j d ƒ S(   Ns   syntaxerror.html(   R   R   (    (    (    s\   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/testsuite/debug.pyR   '   s    s  (?sm)
  File ".*?syntaxerror.html", line 4, in (template|<module>)
    \{% 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\   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/testsuite/debug.pyt   test_syntax_error"   s    c         C   s   d „  } |  j  | d ƒ d  S(   Nc           S   s   t  d d ƒ ‚ d  S(   Nt   wtfi*   (   R   (    (    (    s\   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/testsuite/debug.pyR
   .   s    sŽ   
  File ".*debug.pyc?", line \d+, in test
    raise TemplateSyntaxError\('wtf', 42\)
(jinja2\.exceptions\.)?TemplateSyntaxError: wtf
  line 42(   R   (   R   R
   (    (    s\   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/testsuite/debug.pyt   test_regular_syntax_error-   s    		(   t   __name__t
   __module__R   R   R   (    (    (    s\   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/testsuite/debug.pyR      s   		c          C   s&   t  j ƒ  }  |  j t  j t ƒ ƒ |  S(   N(   t   unittestt	   TestSuitet   addTestt	   makeSuiteR   (   t   suite(    (    s\   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/testsuite/debug.pyR   7   s    (   t   __doc__R   t   jinja2.testsuiteR    R   t   jinja2R   R   R   R   R   (    (    (    s\   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/testsuite/debug.pyt   <module>
   s   #