ok
Direktori : /proc/thread-self/root/proc/self/root/lib/python2.7/site-packages/jinja2/testsuite/ |
Current File : //proc/thread-self/root/proc/self/root/lib/python2.7/site-packages/jinja2/testsuite/regression.pyo |
� ,��Qc @ s� d Z d d l Z d d l m Z d d l m Z m Z m Z m Z m Z m Z d d l m Z e � Z d e f d � � YZ d e f d � � YZ d � Z d S( s� jinja2.testsuite.regression ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tests corner cases and bugs. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. i����N( t JinjaTestCase( t Templatet Environmentt DictLoadert TemplateSyntaxErrort TemplateNotFoundt PrefixLoader( t text_typet CornerTestCasec B s e Z d � Z d � Z RS( c C s1 t j d � } t j d � } t j d � } d S( Nsv {%- for item in (1, 2, 3, 4) -%} [{{ item }}] {%- endfor %} {{- item -}} s� {%- for item in (1, 2, 3, 4) -%} [{{ item }}] {%- endfor %} {%- set item = 42 %} {{- item -}} s� {%- set item = 42 %} {%- for item in (1, 2, 3, 4) -%} [{{ item }}] {%- endfor %} {{- item -}} ( t envt from_string( t selft t( ( s? /usr/lib/python2.7/site-packages/jinja2/testsuite/regression.pyt test_assigned_scoping s c C s1 t j d � } t j d � } t j d � } d S( Ns� {%- set wrapper = "<FOO>" %} {%- for item in (1, 2, 3, 4) %} {%- macro wrapper() %}[{{ item }}]{% endmacro %} {{- wrapper() }} {%- endfor %} {{- wrapper -}} s� {%- for item in (1, 2, 3, 4) %} {%- macro wrapper() %}[{{ item }}]{% endmacro %} {{- wrapper() }} {%- endfor %} {%- set wrapper = "<FOO>" %} {{- wrapper -}} s� {%- for item in (1, 2, 3, 4) %} {%- macro wrapper() %}[{{ item }}]{% endmacro %} {{- wrapper() }} {%- endfor %} {{- wrapper -}} ( R R ( R R ( ( s? /usr/lib/python2.7/site-packages/jinja2/testsuite/regression.pyt test_closure_scoping3 s ( t __name__t __module__R R ( ( ( s? /usr/lib/python2.7/site-packages/jinja2/testsuite/regression.pyR s t BugTestCasec B s� e Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z RS( c C s t � } d � | j d <d S( Nc S s | | S( N( ( t valuet some( ( s? /usr/lib/python2.7/site-packages/jinja2/testsuite/regression.pyt <lambda>V s t testing( R t filters( R R ( ( s? /usr/lib/python2.7/site-packages/jinja2/testsuite/regression.pyt test_keyword_foldingT s c C s/ t d t i d d 6� � } | j d � } d S( Nt loaders# (({% block title %}{% endblock %}))s parent.htmls� {% if expr %}{% extends "parent.html" %}{% endif %}[[{% block title %}title{% endblock %}]]{% for item in [1, 2, 3] %}({{ item }}){% endfor %}( R R R ( R R R ( ( s? /usr/lib/python2.7/site-packages/jinja2/testsuite/regression.pyt test_extends_output_bugsZ s c C s t j d � } d S( Ns* {{ "http://www.example.org/<foo"|urlize }}( R R ( R t tmpl( ( s? /usr/lib/python2.7/site-packages/jinja2/testsuite/regression.pyt test_urlize_filter_escapinge s c C s t j d � } d S( Ns7 {% macro test() %} {{ caller() }} {% endmacro %} {% for num1 in range(5) %} {% call test() %} {% for num2 in range(10) %} {{ loop.index }} {% endfor %} {% endcall %} {% endfor %} ( R R ( R R ( ( s? /usr/lib/python2.7/site-packages/jinja2/testsuite/regression.pyt test_loop_call_loopi s c C s) t d d � } | j t | j d � d S( Nt line_statement_prefixt %s+ % for item in seq {# missing #} ...% endfor( R t assert_raisesR R ( R R ( ( s? /usr/lib/python2.7/site-packages/jinja2/testsuite/regression.pyt test_weird_inline_comment| s c C s t j d � } d S( NsO {% for i in (1, 2) %}{{ i }}{% endfor %}{% macro i() %}3{% endmacro %}{{ i() }}( R R ( R R ( ( s? /usr/lib/python2.7/site-packages/jinja2/testsuite/regression.pyt test_old_macro_loop_scoping_bug� s c C s t j d � } d S( Ns, {% if b %}{% set a = 42 %}{% endif %}{{ a }}( R R ( R R ( ( s? /usr/lib/python2.7/site-packages/jinja2/testsuite/regression.pyt$ test_partial_conditional_assignments� s c C s"