ó
¨œž[c           @` s%  d  d l  m Z m Z m Z d  d l Z d  d l Z d  d l Z d  d l m Z m	 Z	 m
 Z
 d  d l m Z m Z m Z m Z d  d l m Z d  d l m Z m Z d e j f d „  ƒ  YZ d	 e j f d
 „  ƒ  YZ d e j f d „  ƒ  YZ d e j f d „  ƒ  YZ d e j f d „  ƒ  YZ d S(   i    (   t   absolute_importt   divisiont   print_functionN(   t   utf8t
   native_strt
   to_unicode(   t   Templatet
   DictLoadert
   ParseErrort   Loader(   t   unittest(   t
   ObjectDictt   unicode_typet   TemplateTestc           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 d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z e j e j e j ƒ  k d ƒ d „  ƒ Z d „  Z RS(   c         C` s,   t  d ƒ } |  j | j d d ƒ d ƒ d  S(   Ns   Hello {{ name }}!t   namet   Bens
   Hello Ben!(   R   t   assertEqualt   generate(   t   selft   template(    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyt   test_simple   s    c         C` s2   t  d ƒ } |  j | j d t d ƒ ƒ d ƒ d  S(   Ns   Hello {{ name }}!R   R   s
   Hello Ben!(   R   R   R   R   (   R   R   (    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyt
   test_bytes   s    c         C` s&   t  d ƒ } |  j | j ƒ  d ƒ d  S(   Ns   2 + 2 = {{ 2 + 2 }}s	   2 + 2 = 4(   R   R   R   (   R   R   (    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyt   test_expressions   s    c         C` s2   t  d ƒ } |  j | j d t d ƒ ƒ d ƒ d  S(   Ns    Hello{# TODO i18n #} {{ name }}!R   R   s
   Hello Ben!(   R   R   R   R   (   R   R   (    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyt   test_comment   s    c         C` s=   t  i d d 6d d 6ƒ } |  j | j d ƒ j ƒ  d ƒ d  S(   Ns%   {% include "header.html" %}
body texts
   index.htmls   header texts   header.htmls   header text
body text(   R   R   t   loadR   (   R   t   loader(    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyt   test_include!   s
    c         C` s=   t  i d d 6d d 6ƒ } |  j | j d ƒ j ƒ  d ƒ d  S(   Nsj   <title>{% block title %}default title{% end %}</title>
<body>{% block body %}default body{% end %}</body>
s	   base.htmlsb   {% extends "base.html" %}
{% block title %}page title{% end %}
{% block body %}page body{% end %}
s	   page.htmls1   <title>page title</title>
<body>page body</body>
(   R   R   R   R   (   R   R   (    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyt   test_extends)   s
    c         C` sD   t  i d d 6d d 6d d 6ƒ } |  j | j d ƒ j ƒ  d ƒ d  S(   Ns   {% include '2.html' %}s   a/1.htmls   {% include '../b/3.html' %}s   a/2.htmlt   oks   b/3.html(   R   R   R   R   (   R   R   (    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyt   test_relative_load8   s    c         C` sš   |  j  t d „  ƒ |  j  t d „  ƒ |  j t d ƒ j ƒ  d ƒ |  j t d ƒ j ƒ  d ƒ |  j t d ƒ j ƒ  d ƒ |  j t d	 ƒ j ƒ  d
 ƒ d  S(   Nc           S` s
   t  d ƒ S(   Ns   {{(   R   (    (    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyt   <lambda>B   s    c           S` s
   t  d ƒ S(   Ns   {%(   R   (    (    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyR   C   s    s   {{!s   {{s   {%!s   {%s   {#!s   {#s   {{ 'expr' }} {{!jquery expr}}s   expr {{jquery expr}}(   t   assertRaisesR   R   R   R   (   R   (    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyt   test_escapingA   s    c         C` s2   t  t d ƒ ƒ } |  j | j ƒ  t d ƒ ƒ d  S(   Nu   Ã©(   R   R   R   R   (   R   R   (    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyt   test_unicode_templateJ   s    c         C` sS   t  t k r! t t d ƒ ƒ } n t t d ƒ ƒ } |  j | j ƒ  t d ƒ ƒ d  S(   Nu
   {{ "Ã©" }}u   {{ u"Ã©" }}u   Ã©(   t   strR   R   R   R   R   (   R   R   (    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyt   test_unicode_literal_expressionN   s    c         C` sF   t  i d d 6d i d „  d 6ƒ} |  j | j d ƒ j ƒ  d ƒ d  S(   Ns   {{ inc(5) }}s	   test.htmlt	   namespacec         S` s   |  d S(   Ni   (    (   t   x(    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyR   \   s    t   inct   6(   R   R   R   R   (   R   R   (    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyt   test_custom_namespace[   s    #c         C` s;   d „  } t  t d ƒ ƒ } |  j | j d | ƒ d ƒ d  S(   Nc         S` s
   |  j  ƒ  S(   N(   t   upper(   t   s(    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyR)   `   s    s   {% apply upper %}foo{% end %}R)   t   FOO(   R   R   R   R   (   R   R)   R   (    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyt
   test_apply_   s    	c         C` sA   d „  } t  t d ƒ ƒ } |  j | j d | ƒ t d ƒ ƒ d  S(   Nc         S` s   t  |  ƒ j ƒ  S(   N(   R   R)   (   R*   (    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyR)   f   s    u    {% apply upper %}foo Ã©{% end %}R)   u   FOO Ã‰(   R   R   R   R   (   R   R)   R   (    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyt   test_unicode_applye   s    	c         C` sA   d „  } t  t d ƒ ƒ } |  j | j d | ƒ t d ƒ ƒ d  S(   Nc         S` s   t  t |  ƒ j ƒ  ƒ S(   N(   R   R   R)   (   R*   (    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyR)   l   s    u    {% apply upper %}foo Ã©{% end %}R)   u   FOO Ã‰(   R   R   R   R   (   R   R)   R   (    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyt   test_bytes_applyk   s    	c         C` sN   t  t d ƒ ƒ } |  j | j d d ƒ d ƒ |  j | j d d ƒ d ƒ d  S(   Ns&   {% if x > 4 %}yes{% else %}no{% end %}R%   i   t   yesi   t   no(   R   R   R   R   (   R   R   (    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyt   test_ifq   s    c         C` s,   t  t d ƒ ƒ } |  j | j ƒ  d ƒ d  S(   Ns    {% if True %}{% else %}{% end %}t    (   R   R   R   R   (   R   R   (    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyt   test_if_empty_bodyv   s    c         C` sN   t  t d ƒ ƒ } |  j | j d d ƒ d ƒ |  j | j d d ƒ d ƒ d  S(   Nsb   {% try %}
try{% set y = 1/x %}
{% except %}-except
{% else %}-else
{% finally %}-finally
{% end %}R%   i   s   
try
-else
-finally
i    s   
try-except
-finally
(   R   R   R   R   (   R   R   (    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyt   test_tryz   s    c         C` s,   t  t d ƒ ƒ } |  j | j ƒ  d ƒ d  S(   Ns   {% comment blah blah %}foot   foo(   R   R   R   R   (   R   R   (    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyt   test_comment_directive„   s    c         C` sG   t  t d ƒ ƒ } | j ƒ  } d j | j ƒ  ƒ } |  j | d ƒ d  S(   Ns   {% for i in range(10) %}
    {% if i == 2 %}
        {% continue %}
    {% end %}
    {{ i }}
    {% if i == 6 %}
        {% break %}
    {% end %}
{% end %}R2   t   013456(   R   R   R   t   joint   splitR   (   R   R   t   result(    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyt   test_break_continueˆ   s
    	c         C` s8   y  t  t d ƒ ƒ t d ƒ ‚ Wn t k
 r3 n Xd  S(   Ns   {% break %}s   Did not get expected exception(   R   R   t	   ExceptionR   (   R   (    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyt   test_break_outside_loop˜   s
    c         C` s8   y  t  t d ƒ ƒ t d ƒ ‚ Wn t k
 r3 n Xd  S(   Ns=   {% for i in [] %}{% apply foo %}{% break %}{% end %}{% end %}s   Did not get expected exception(   R   R   R<   R   (   R   (    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyt   test_break_in_applyŸ   s
    s   no testable future importsc         C` s6   |  j  d d ƒ t d ƒ } |  j  | j ƒ  d ƒ d  S(   Ni   i   g      à?s   {{ 1 / 2 }}t   0g      à?(   R   R   R   (   R   R   (    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyt   test_no_inherit_future¨   s    c         C` s6   t  i d d 6ƒ } |  j | j d ƒ j ƒ  d ƒ d  S(   Nt   hellou
   tÃ©st.html(   R   R   R   R   (   R   R   (    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyt   test_non_ascii_name±   s    (   t   __name__t
   __module__R   R   R   R   R   R   R   R    R!   R#   R(   R,   R-   R.   R1   R3   R4   R6   R;   R=   R>   R
   t   skipIft   syst   version_infoR   t   getMandatoryReleaseR@   RB   (    (    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyR      s0   																			
					t   StackTraceTestc           B` sG   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   c         C` sh   t  i d d 6ƒ } y$ | j d ƒ j ƒ  |  j d ƒ Wn* t k
 rc |  j d t j ƒ  k ƒ n Xd  S(   Ns   one
two{{1/0}}
three
        s	   test.htmls   did not get expected exceptions   # test.html:2(   R   R   R   t   failt   ZeroDivisionErrort
   assertTruet	   tracebackt
   format_exc(   R   R   (    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyt!   test_error_line_number_expression·   s    c         C` sh   t  i d d 6ƒ } y$ | j d ƒ j ƒ  |  j d ƒ Wn* t k
 rc |  j d t j ƒ  k ƒ n Xd  S(   Ns'   one
two{%if 1/0%}
three{%end%}
        s	   test.htmls   did not get expected exceptions   # test.html:2(   R   R   R   RJ   RK   RL   RM   RN   (   R   R   (    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyt    test_error_line_number_directiveÂ   s    c         ` s³   d  ‰  ‡  f d †  } t i d d 6d d 6d i t d | ƒ d 6ƒ‰  y$ ˆ  j d ƒ j ƒ  |  j d	 ƒ WnC t k
 r® t j ƒ  } |  j	 d
 | k ƒ |  j	 d | k ƒ n Xd  S(   Nc         ` s   ˆ  j  |  ƒ j |   S(   N(   R   R   (   t   patht   kwargs(   R   (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyt   load_generateÐ   s    s!   {% module Template('sub.html') %}s	   base.htmls   {{1/0}}s   sub.htmlR$   R   t   _tt_moduless   did not get expected exceptions   # base.html:1s   # sub.html:1(
   t   NoneR   R   R   R   RJ   RK   RM   RN   RL   (   R   RS   t	   exc_stack(    (   R   s9   lib/python2.7/site-packages/tornado/test/template_test.pyt   test_error_line_number_moduleÍ   s    
c         C` so   t  i d d 6d d 6ƒ } y$ | j d ƒ j ƒ  |  j d ƒ Wn* t k
 rj |  j d t j ƒ  k ƒ n Xd  S(   Ns   {% include 'sub.html' %}s	   base.htmls   {{1/0}}s   sub.htmls   did not get expected exceptions   # sub.html:1 (via base.html:1)(   R   R   R   RJ   RK   RL   RM   RN   (   R   R   (    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyt   test_error_line_number_includeß   s    	c         C` su   t  i d d 6d d 6ƒ } y$ | j d ƒ j ƒ  |  j d ƒ Wn t k
 r] t j ƒ  } n X|  j d | k ƒ d  S(   Ns   {{1/0}}s	   base.htmls   {% extends 'base.html' %}s   sub.htmls   did not get expected exceptions   # base.html:1(   R   R   R   RJ   RK   RM   RN   RL   (   R   R   RV   (    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyt)   test_error_line_number_extends_base_errorë   s    c         C` so   t  i d d 6d d 6ƒ } y$ | j d ƒ j ƒ  |  j d ƒ Wn* t k
 rj |  j d t j ƒ  k ƒ n Xd  S(   Ns   {% block 'block' %}{% end %}s	   base.htmlsM   
{% extends 'base.html' %}
{% block 'block' %}
{{1/0}}
{% end %}
            s   sub.htmls   did not get expected exceptions   # sub.html:4 (via base.html:1)(   R   R   R   RJ   RK   RL   RM   RN   (   R   R   (    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyt(   test_error_line_number_extends_sub_error÷   s    	c         C` sv   t  i d d 6d d 6d d 6ƒ } y$ | j d ƒ j ƒ  |  j d ƒ Wn* t k
 rq |  j d t j ƒ  k ƒ n Xd  S(	   Ns   {% include 'b.html' %}s   a.htmls   {% include 'c.html' %}s   b.htmls   {{1/0}}s   c.htmls   did not get expected exceptions#   # c.html:1 (via b.html:1, a.html:1)(   R   R   R   RJ   RK   RL   RM   RN   (   R   R   (    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyt   test_multi_includes  s    	(	   RC   RD   RO   RP   RW   RX   RY   RZ   R[   (    (    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyRI   ¶   s   						t   ParseErrorDetailTestc           B` s   e  Z d  „  Z d „  Z RS(   c         C` s   t  i d d 6ƒ } |  j t ƒ  } | j d ƒ Wd  QX|  j d t | j ƒ ƒ |  j d | j j ƒ |  j d | j j ƒ d  S(   Ns   

{{s   foo.htmls'   Missing end expression }} at foo.html:3i   (	   R   R   R   R   R   R"   t	   exceptiont   filenamet   lineno(   R   R   t   cm(    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyt   test_details  s    	c         C` s    |  j  d t t d ƒ ƒ ƒ d  S(   Ns   asdf at None:0t   asdf(   R   R"   R   (   R   (    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyt   test_custom_parse_error!  s    (   RC   RD   Ra   Rc   (    (    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyR\     s   	t   AutoEscapeTestc           B` sk   e  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` sZ   i d d 6d d 6d d 6d d 6d	 d
 6d d 6d d 6d d 6d d 6d d 6d d 6|  _  d  S(   Ns'   {% autoescape xhtml_escape %}{{ name }}s   escaped.htmls   {% autoescape None %}{{ name }}s   unescaped.htmls
   {{ name }}s   default.htmlsv   escaped: {% include 'escaped.html' %}
unescaped: {% include 'unescaped.html' %}
default: {% include 'default.html' %}
s   include.htmlsF   {% autoescape xhtml_escape %}{% block name %}base: {{ name }}{% end %}s   escaped_block.htmls>   {% autoescape None %}{% block name %}base: {{ name }}{% end %}s   unescaped_block.htmlsA   {% autoescape xhtml_escape %}{% extends "unescaped_block.html" %}s   escaped_extends_unescaped.htmlsn   {% autoescape xhtml_escape %}{% extends "unescaped_block.html" %}{% block name %}extended: {{ name }}{% end %}s    escaped_overrides_unescaped.htmls7   {% autoescape None %}{% extends "escaped_block.html" %}s   unescaped_extends_escaped.htmlsd   {% autoescape None %}{% extends "escaped_block.html" %}{% block name %}extended: {{ name }}{% end %}s    unescaped_overrides_escaped.htmlsA   {% autoescape xhtml_escape %}expr: {{ name }}
raw: {% raw name %}s   raw_expression.html(   t	   templates(   R   (    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyt   setUp(  s    c         C` s³   t  |  j d d  ƒ} d } |  j | j d ƒ j d | ƒ d ƒ |  j | j d ƒ j d | ƒ d ƒ |  j | j d ƒ j d | ƒ d ƒ |  j | j d ƒ j d | ƒ d	 ƒ d  S(
   Nt
   autoescapes   Bobby <table>ss   escaped.htmlR   s   Bobby &lt;table&gt;ss   unescaped.htmls   default.htmls   include.htmlsP   escaped: Bobby &lt;table&gt;s
unescaped: Bobby <table>s
default: Bobby <table>s
(   R   Re   RU   R   R   R   (   R   R   R   (    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyt   test_default_offR  s    c         C` s³   t  |  j d d ƒ} d } |  j | j d ƒ j d | ƒ d ƒ |  j | j d ƒ j d | ƒ d ƒ |  j | j d ƒ j d | ƒ d ƒ |  j | j d	 ƒ j d | ƒ d
 ƒ d  S(   NRg   t   xhtml_escapes   Bobby <table>ss   escaped.htmlR   s   Bobby &lt;table&gt;ss   unescaped.htmls   default.htmls   include.htmlsV   escaped: Bobby &lt;table&gt;s
unescaped: Bobby <table>s
default: Bobby &lt;table&gt;s
(   R   Re   R   R   R   (   R   R   R   (    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyt   test_default_ona  s    c         C` sc   t  |  j ƒ } d } |  j | j d ƒ j d | ƒ d ƒ |  j | j d ƒ j d | ƒ d ƒ d  S(   Ns   <script>s   escaped_block.htmlR   s   base: &lt;script&gt;s   unescaped_block.htmls   base: <script>(   R   Re   R   R   R   (   R   R   R   (    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyt   test_unextended_blockp  s    c         ` sz   t  |  j ƒ ‰  ‡  f d †  } |  j | d ƒ d ƒ |  j | d ƒ d ƒ |  j | d ƒ d ƒ |  j | d ƒ d	 ƒ d  S(
   Nc         ` s   ˆ  j  |  ƒ j d d ƒ S(   NR   s   <script>(   R   R   (   R   (   R   (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyt   render{  s    s   escaped_extends_unescaped.htmls   base: <script>s    escaped_overrides_unescaped.htmls   extended: &lt;script&gt;s   unescaped_extends_escaped.htmls   base: &lt;script&gt;s    unescaped_overrides_escaped.htmls   extended: <script>(   R   Re   R   (   R   Rl   (    (   R   s9   lib/python2.7/site-packages/tornado/test/template_test.pyt   test_extended_blockx  s    c         ` s8   t  |  j ƒ ‰  ‡  f d †  } |  j | d ƒ d ƒ d  S(   Nc         ` s   ˆ  j  |  ƒ j d d ƒ S(   NR   s   <>&"(   R   R   (   R   (   R   (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyRl   Š  s    s   raw_expression.htmls#   expr: &lt;&gt;&amp;&quot;
raw: <>&"(   R   Re   R   (   R   Rl   (    (   R   s9   lib/python2.7/site-packages/tornado/test/template_test.pyt   test_raw_expression‡  s    c         ` s†   t  i d d 6ƒ ‰  ‡ f d †  ‰ ‡  ‡ f d †  } ˆ j | d d ƒ d ƒ ˆ j | d d ƒ d ƒ ˆ j | d d	 g ƒ d
 ƒ d  S(   Ns)   {% autoescape py_escape %}s = {{ name }}
s   foo.pyc         ` s&   ˆ  j  t |  ƒ t ƒ t t |  ƒ ƒ S(   N(   R   t   typet   bytest   reprR   (   R*   (   R   (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyt	   py_escape”  s    c         ` s   ˆ  j  |  ƒ j d ˆ d | ƒ S(   NRr   R   (   R   R   (   R   R   (   R   Rr   (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyRl   ˜  s    s   <html>s   s = '<html>'
s   ';sys.exit()s   s = "';sys.exit()"
s   not a strings   s = "['not a string']"
(   R   R   (   R   Rl   (    (   R   Rr   R   s9   lib/python2.7/site-packages/tornado/test/template_test.pyt   test_custom_escape  s    c         C` sB   t  i d d 6ƒ } |  j | j d ƒ j d t d ƒ ƒ d ƒ d  S(   NsG   {% for i in items
  %}{% if i > 0 %}, {% end %}{#
  #}{{i
  }}{% end
%}s   foo.txtt   itemsi   s   0, 1, 2, 3, 4(   R   R   R   R   t   range(   R   R   (    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyt   test_manual_minimize_whitespace¢  s    $c         C` sÎ   t  i d d 6d d 6d d 6d d 6d	 d
 6ƒ } |  j | j d ƒ j ƒ  d ƒ |  j | j d ƒ j ƒ  d ƒ |  j | j d ƒ j ƒ  d ƒ |  j | j d ƒ j ƒ  d ƒ |  j | j d
 ƒ j ƒ  d ƒ d  S(   Ns      
	
 asdf	   s   foo.htmls    


	 qwer     s   bar.jss   	    zxcv

s   baz.txts     {% include baz.txt %} 
 s   include.htmls   		{% include foo.html %}    s   include.txts   
asdf s   
qwer s    	    zxcv


s   		
asdf     (   R   R   R   R   (   R   R   (    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyt   test_whitespace_by_filename°  s     c         C` s  i d d 6d d 6} t  | d d ƒ} |  j | j d ƒ j ƒ  d ƒ |  j | j d ƒ j ƒ  d ƒ t  | d d ƒ} |  j | j d ƒ j ƒ  d ƒ |  j | j d ƒ j ƒ  d	 ƒ t  | d d
 ƒ} |  j | j d ƒ j ƒ  d ƒ |  j | j d ƒ j ƒ  d ƒ d  S(   Ns   		foo

s   foo.htmls   		bar

s   bar.txtt
   whitespacet   allt   singles    foo
s    bar
t   onelines    foo s    bar (   R   R   R   R   (   R   Re   R   (    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyt   test_whitespace_by_loaderÊ  s    
c         C` s6   t  i d d 6ƒ } |  j | j d ƒ j ƒ  d ƒ d  S(   Nsz   {% whitespace oneline %}
    {% for i in range(3) %}
        {{ i }}
    {% end %}
{% whitespace all %}
    pre	formatted
s   foo.htmls     0  1  2  
    pre	formatted
(   R   R   R   R   (   R   R   (    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyt   test_whitespace_directiveÛ  s    (   RC   RD   Rf   Rh   Rj   Rk   Rm   Rn   Rs   Rv   Rw   R|   R}   (    (    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyRd   '  s   	*										t   TemplateLoaderTestc           B` s   e  Z d  „  Z d „  Z RS(   c         C` s.   t  t j j t j j t ƒ d ƒ ƒ |  _ d  S(   NRe   (   R	   t   osRQ   R8   t   dirnamet   __file__R   (   R   (    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyRf   ê  s    c         C` s>   |  j  j d ƒ } | j ƒ  } |  j t | ƒ j ƒ  d ƒ d  S(   Ns	   utf8.htmlu   HÃ©llo(   R   R   R   R   R   t   strip(   R   t   tmplR:   (    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyt   test_utf8_in_fileí  s    (   RC   RD   Rf   R„   (    (    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyR~   é  s   	(   t
   __future__R    R   R   R   RF   RM   t   tornado.escapeR   R   R   t   tornado.templateR   R   R   R	   t   tornado.test.utilR
   t   tornado.utilR   R   t   TestCaseR   RI   R\   Rd   R~   (    (    (    s9   lib/python2.7/site-packages/tornado/test/template_test.pyt   <module>   s   "©_Â