File: //opt/alt/python27/lib/python2.7/site-packages/jinja2/testsuite/imports.pyc
�
~KRc
@ s� d Z d d l Z d d l m Z d d l m Z m Z d d l m Z m Z e d e e
d d d d
d d � � � Z d
e j d <d e f d � � YZ
d e f d � � YZ d � Z d S( s�
jinja2.testsuite.imports
~~~~~~~~~~~~~~~~~~~~~~~~
Tests the import features (with includes).
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
i����N( t
JinjaTestCase( t Environmentt
DictLoader( t TemplateNotFoundt TemplatesNotFoundt loadert modules5 {% macro test() %}[{{ foo }}|{{ bar }}]{% endmacro %}t headers [{{ foo }}|{{ 23 }}]t o_printers ({{ o }})i t bart ImportsTestCasec B s# e Z d � Z d � Z d � Z RS( c C s t j d � } | j d d � d k s- t � t j d � } | j d d � d k sZ t � t j d � } | j d d � d k s� t � t j d � } | j d d � d k s� t � t j d � } | j d d � d k s� t � t j d
� } | j d d � d k st � d S( Ns( {% import "module" as m %}{{ m.test() }}t fooi* s [|23]s8 {% import "module" as m without context %}{{ m.test() }}s5 {% import "module" as m with context %}{{ m.test() }}s [42|23]s+ {% from "module" import test %}{{ test() }}s; {% from "module" import test without context %}{{ test() }}s8 {% from "module" import test with context %}{{ test() }}( t test_envt from_stringt rendert AssertionError( t selft t( ( sI /opt/alt/python27/lib/python2.7/site-packages/jinja2/testsuite/imports.pyt test_context_imports s c C sE t j d � t j d � t j d � t j d � t j d � d S( Ns- {% from "foo" import bar, baz with context %}s. {% from "foo" import bar, baz, with context %}s) {% from "foo" import bar, with context %}s* {% from "foo" import bar, with, context %}s. {% from "foo" import bar, with with context %}( R R
( R ( ( sI /opt/alt/python27/lib/python2.7/site-packages/jinja2/testsuite/imports.pyt test_trailing_comma+ s
c C so t j d � j } | j � d k s* t � t | d � s@ t � | j d k sU t � t | d � sk t � d S( Ns
{% macro toplevel() %}...{% endmacro %}
{% macro __private() %}...{% endmacro %}
{% set variable = 42 %}
{% for item in [1] %}
{% macro notthere() %}{% endmacro %}
{% endfor %}
s ...t __missingi* t notthere( R R
R t toplevelR t hasattrt variable( R t m( ( sI /opt/alt/python27/lib/python2.7/site-packages/jinja2/testsuite/imports.pyt test_exports2 s ( t __name__t
__module__R R R ( ( ( sI /opt/alt/python27/lib/python2.7/site-packages/jinja2/testsuite/imports.pyR
s t IncludesTestCasec B s5 e Z d � Z d � Z d � Z d � Z d � Z RS( c C s� t j d � } | j d d � d k s- t � t j d � } | j d d � d k sZ t � t j d � } | j d d � d k s� t � d S( Ns {% include "header" %}R i* s [42|23]s# {% include "header" with context %}s&