ok

Mini Shell

Direktori : /lib/python2.7/site-packages/jinja2/testsuite/
Upload File :
Current File : //lib/python2.7/site-packages/jinja2/testsuite/loader.pyc

�
,��Qc@s�dZddlZddlZddlZddlZddlZddlmZmZm	Z	m
Z
mZmZm
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(	cCsVtdt�}|jd�}|j�j�dks<t�|jt|jd�dS(Ntloaders
justdict.htmltFOOsmissing.html(RRtget_templatetrendertstriptAssertionErrort
assert_raisesR(tselftenvttmpl((s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pyttest_dict_loaderscCsVtdt�}|jd�}|j�j�dks<t�|jt|jd�dS(NRs	test.htmltBARsmissing.html(RRRRRRRR(RRR((s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pyttest_package_loader#scCs�tdt�}|jd�}|j�j�dks<t�|jd�}|j�j�dksit�|jt|jd�dS(NRs	test.htmlRs
foo/test.htmlRsmissing.html(RRRRRRRR(RRR((s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pyttest_filesystem_loader)scCs�tdt�}|jd�}|j�j�dks<t�|jd�}|j�j�dksit�|jt|jd�dS(NRs
justdict.htmlRs	test.htmlRsmissing.html(RRRRRRRR(RRR((s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pyttest_choice_loader1scCsVtdt�}|jd�}|j�j�dks<t�|jt|jd�dS(NRsjustfunction.htmlRsmissing.html(RRRRRRRR(RRR((s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pyttest_function_loader9scCs�tdt�}|jd�}|j�j�dks<t�|jd�}|j�j�dksit�|jt|jd�dS(NRsa/test.htmlRsb/justdict.htmlRtmissing(RRRRRRRR(RRR((s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pyttest_prefix_loader?scs�t�dtjf�fd��Y}td|�dd�}|jd�}||jd�ksgt�t�||jd�k	s�t�t�td|�dd�}|jd�|jd�k	s�t�td|�dd�}|jd	�}|jd
�}||jd
�kst�||jd	�ks6t�|jd�}d	|jksZt�d
|jksot�d|jks�t�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.pyR IsRt
cache_sizei����R%iitonettwotthree(tFalseRt
BaseLoaderRRRtTruetcache(RR RRtt1tt2tt3((R!s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pyttest_cachingGs(cCsuidd6}tdtj|��}|jd�j�dksFt�d|d<|jd�j�dksqt�dS(NR*tfooRR+(RRt
DictLoaderRRR(RtmappingR((s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pyt"test_dict_loader_cache_invalidatesas

!
cCsStd�ddgkst�td�ddgks<t�|jttd�dS(Nsfoo/barR5tbars	./foo/bars../foo(RRRR(R((s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pyttest_split_template_pathhs(R'R(RRRRRRR4R8R:(((s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pyR
s								tModuleLoaderTestCasecBs�eZdZded�Zd�Zd�Zd�Zd�Z	d�Z
d�Zd�Ze
rsersd	�Znd
�Zd�ZRS(
tdeflatedcCs�tt|�j�g}tdt�|_|dk	rStjdd�d|_	ntj
�|_	|jj|j	d|d|jd|�tdt
j|j	��|_dj|�S(	NRtsuffixs.zipitziptlog_functiont
py_compilet(tsuperR;tsetupRRtreg_envR#ttempfiletmkstemptarchivetmkdtemptcompile_templatestappendRtModuleLoadertmod_envtjoin(RR>R@tlog((s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pytcompile_downqs	cCsjtt|�j�t|d�rftjj|j�rJtj|j�nt	j
|j�d|_ndS(NRL(RBR;tteardownthasattrtostpathtisfileRGtremovetshutiltrmtreeR#(R((s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pyRPscCsF|j�}d|kst�d|ks0t�d|ksBt�dS(NsKCompiled "a/foo/test.html" as tmpl_a790caf9d669e39ea4d280d597ec891c4ef0404asFinished compiling templatessGCould not compile "a/syntaxerror.html": Encountered unknown tag 'endif'(ROR(RRN((s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pyttest_log�scCs�|jjd�}|jjd�}|j�|j�ksBt�|jjd�}|jjd�}|j�|j�ks�t�dS(Nsa/test.htmlsb/justdict.html(RDRRLRR(Rttmpl1ttmpl2((s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pyt_test_common�scCs|jdd�|j�dS(NR>R<(ROR[(R((s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pyttest_deflated_zip_compile�scCs|jdd�|j�dS(NR>tstored(ROR[(R((s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pyttest_stored_zip_compile�scCs|jdd�|j�dS(NR>(ROR#R[(R((s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pyttest_filesystem_compile�scCs�|j�|jjd�}tjjd�}|jjjj}t	|jjj|�s^t
�|tjksst
�d|_}yddl}|j�WnnX|tjks�t
�dS(Nsa/test.htmli����(RORLRRRKtget_template_keyRtmoduleR'RQRtsystmodulesR#tgctcollect(RRtkeytnameRd((s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pyttest_weak_references�s

cCsd|jdt�}d|ks$t�|jjd�}|jjjj}|jj	d�s`t�dS(NR@sByte-compiled "a/test.html"sa/test.htmls.pyc(
ROR/RRLRRRat-tmpl_3c4ddf650c1a73df961a6d3d2ce2752f1b8fd490t__file__tendswith(RRNRYtmod((s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pyttest_byte_compilation�s
cCs�|j�}tj|jjtjidd6�g�|j_|jjd�}|j|j�d�|jjd�}|j|j�d�dS(Nt
DICT_TEMPLATEtDICT_SOURCEsa/test.htmlR(	RORtChoiceLoaderRLRR6Rtassert_equalR(RRNRYRZ((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(NtMODRns	test.htmltDICTsMOD/a/test.htmlRsDICT/test.html(	RORtPrefixLoaderRLRR6RRqR(RRNRYRZ((s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pyR�s	
#N(R'R(R#RGR-RORPRXR[R\R^R_RhR
R	RmRR(((s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pyR;ns									
	
cCs<tj�}|jtjt��|jtjt��|S(N(tunittestt	TestSuitetaddTestt	makeSuiteR
R;(tsuite((s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pyRy�s(t__doc__RRRbRERVRutjinja2.testsuiteRRRRRRRtjinja2RRtjinja2._compatR	R
tjinja2.loadersRtjinja2.exceptionsRR
R;Ry(((s;/usr/lib/python2.7/site-packages/jinja2/testsuite/loader.pyt<module>
s4Sp

Zerion Mini Shell 1.0