Spade
Mini Shell
| Directory:~$ /lib/python2.7/site-packages/jinja2/testsuite/ |
| [Home] [System Details] [Kill Me] |
�
,��Qc@s�dZddlZddlZddlZddlZddlZddlmZmZm Z m
Z
mZmZm
Z
ddlmZmZddlmZmZddlmZddlmZdefd ��YZd
efd��YZd�ZdS(
s�
jinja2.testsuite.loader
~~~~~~~~~~~~~~~~~~~~~~~
Test the loaders.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
i����N(t
JinjaTestCasetdict_loadertpackage_loadertfilesystem_loadertfunction_loadert
choice_loadert
prefix_loader(tEnvironmenttloaders(tPYPYtPY2(tsplit_template_path(tTemplateNotFoundtLoaderTestCasecBsYeZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z
RS( cCs8tdt�}|jd�}|jt|jd�dS(Ntloaders
justdict.htmlsmissing.html(RRtget_templatet
assert_raisesR(tselftenvttmpl((s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pyttest_dict_loaderscCs8tdt�}|jd�}|jt|jd�dS(NRs test.htmlsmissing.html(RRRRR(RRR((s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pyttest_package_loader#scCsGtdt�}|jd�}|jd�}|jt|jd�dS(NRs test.htmls
foo/test.htmlsmissing.html(RRRRR(RRR((s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pyttest_filesystem_loader)scCsGtdt�}|jd�}|jd�}|jt|jd�dS(NRs
justdict.htmls test.htmlsmissing.html(RRRRR(RRR((s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pyttest_choice_loader1scCs8tdt�}|jd�}|jt|jd�dS(NRsjustfunction.htmlsmissing.html(RRRRR(RRR((s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pyttest_function_loader9scCsGtdt�}|jd�}|jd�}|jt|jd�dS(NRsa/test.htmlsb/justdict.htmltmissing(RRRRR(RRR((s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pyttest_prefix_loader?scs�t�dtjf�fd��Y}td|�dd�}|jd�}t�t�td|�dd�}td|�dd�}|jd �}|jd
�}|jd�}dS(Nt
TestLoadercseZ�fd�ZRS(csdd�fd�fS(Nufoocs�S(N(((tchanged(s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pyt<lambda>Ks(tNone(Rtenvironmentttemplate(R(s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pyt
get_sourceJs(t__name__t
__module__R!((R(s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pyRIsRt
cache_sizei����R iitonettwotthree(tFalseRt
BaseLoaderRRtTrue(RRRRtt1tt2tt3((Rs;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pyttest_cachingGscCs3idd6}tdtj|��}d|d<dS(NR%tfooRR&(RRt
DictLoader(RtmappingR((s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pyt"test_dict_loader_cache_invalidatesas
cCs|jttd�dS(Ns../foo(RRR(R((s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pyttest_split_template_pathhs(R"R#RRRRRRR.R2R3(((s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pyR
s tModuleLoaderTestCasecBs�eZdZded�Zd�Zd�Zd�Zd�Z d�Z
d�Zd�Ze
rsersd �Znd
�Zd�ZRS(
tdeflatedcCs�tt|�j�g}tdt�|_|dk rStjdd�d|_ ntj
�|_ |jj|j d|d|jd|�tdt
j|j ��|_dj|�S( NRtsuffixs.zipitziptlog_functiont
py_compilet(tsuperR4tsetupRRtreg_envRttempfiletmkstemptarchivetmkdtemptcompile_templatestappendRtModuleLoadertmod_envtjoin(RR7R9tlog((s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pytcompile_downqs cCsjtt|�j�t|d�rftjj|j�rJtj|j�nt j
|j�d|_ndS(NRE(R;R4tteardownthasattrtostpathtisfileR@tremovetshutiltrmtreeR(R((s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pyRIscCs|j�}dS(N(RH(RRG((s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pyttest_log�scCsL|jjd�}|jjd�}|jjd�}|jjd�}dS(Nsa/test.htmlsb/justdict.html(R=RRE(Rttmpl1ttmpl2((s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pyt_test_common�s
cCs|jdd�|j�dS(NR7R5(RHRT(R((s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pyttest_deflated_zip_compile�scCs|jdd�|j�dS(NR7tstored(RHRT(R((s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pyttest_stored_zip_compile�scCs|jdd�|j�dS(NR7(RHRRT(R((s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pyttest_filesystem_compile�scCsu|j�|jjd�}tjjd�}|jjjj}d|_}yddl
}|j�WnnXdS(Nsa/test.htmli����(RHRERRRDtget_template_keyRtmoduleR"Rtgctcollect(RRtkeytnameR[((s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pyttest_weak_references�s
cCs:|jdt�}|jjd�}|jjjj}dS(NR9sa/test.html(RHR*RERRRZt-tmpl_3c4ddf650c1a73df961a6d3d2ce2752f1b8fd490(RRGRRtmod((s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pyttest_byte_compilation�scCs�|j�}tj|jjtjidd6�g�|j_|jjd�}|j|j�d�|jjd�}|j|j�d�dS(Nt
DICT_TEMPLATEtDICT_SOURCEsa/test.htmltBAR( RHRtChoiceLoaderRERR0Rtassert_equaltrender(RRGRRRS((s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pyR�s "cCs�|j�}tji|jjd6tjidd6�d6�|j_|jjd�}|j|j�d�|jjd�}|j|j�d�dS(NtMODRcs test.htmltDICTsMOD/a/test.htmlResDICT/test.html( RHRtPrefixLoaderRERR0RRgRh(RRGRRRS((s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pyR�s
#N(R"R#RR@R(RHRIRQRTRURWRXR_R
R RbRR(((s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pyR4ns
cCs<tj�}|jtjt��|jtjt��|S(N(tunittestt TestSuitetaddTestt makeSuiteR
R4(tsuite((s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pyRp�s(t__doc__RKtsysR>RORltjinja2.testsuiteRRRRRRRtjinja2RRtjinja2._compatR R
tjinja2.loadersRtjinja2.exceptionsRR
R4Rp(((s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pyt<module>
s4Sp