PL i ddlZddlmZddlmZddlmZddlmZddlmZGdd Z Gd d eZ ed e d y) N) CacheImpl)register_plugin)Template)eq_)configcHeZdZdZdZ ddZ ddZ d dZdZy) TemplateTestc ^|j|}td||tjd|S)N)urifilenamemodule_directory) _file_pathrr module_base)selfr kwfilepaths [/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/mako/testing/fixtures.py_file_templatezTemplateTest._file_template s;??8, #//    cLtjj|\}}tjjtj |dz|z}tjj |r|Stjjtj |S)N_py3k)ospathsplitextjoinr template_baseexists)rr nameext py3k_paths rrzTemplateTest._file_pathsnGG$$X. cGGLL!5!5tg~7KL 77>>) $ ww||F00(;;rNc V|j|fi|}|j|||||y)Nfiltersunicode_ template_args)r_do_test)rr expectedr%r&r'rt1s r _do_file_testzTemplateTest._do_file_tests;!T  0R 0  '  rc Jtdd|i|}|j|||||y)Ntextr$r)rr()rsourcer)r%r&r'rr*s r_do_memory_testzTemplateTest._do_memory_test.s6 (6 (R (  '  rc|i}|r|jdi|}n|jdi|}|r||}t||yNr)render_unicoderenderr)rtemplater)r%r'r&outputs rr(zTemplateTest._do_test@sP  M ,X,,=}=F$X__5}5F V_F FHrcPd|d}d|dd|df}tfd|DS)Nz'zlocal variable z referenced before assignmentzcannot access local variable z where it is not associatedc3&K|]}|v ywNr).0msgrendered_outputs r z=TemplateTest.indicates_unbound_local_error..[sBC?*Bs)any)rr; unbound_varvar error_msgss ` rindicates_unbound_local_errorz*TemplateTest.indicates_unbound_local_errorSsGk]%(cU"? @+C50K L  BzBBBr)NTN)NNT) __name__ __module__ __qualname__rrr+r/r(rArrrr r sB <  ,  , &Crr c.eZdZdZdZdZdZdZdZy)PlainCacheImplzTSimple memory cache impl so that tests which use caching can run without beaker.c ||_i|_yr8)cachedata)rrHs r__init__zPlainCacheImpl.__init__bs  rc n||jvr|j|S|di|x|j|<}|Sr1rI)rkeycreation_functionrrIs r get_or_createzPlainCacheImpl.get_or_createfs; $)) 99S> !$5$;$; ;DIIcNTKrc "||j|<yr8rL)rrMvaluers rputzPlainCacheImpl.putms #rc |j|Sr8rLrrMrs rgetzPlainCacheImpl.getpsyy~rc |j|=yr8rLrTs r invalidatezPlainCacheImpl.invalidatess IIcNrN) rBrCrD__doc__rJrOrRrUrWrrrrFrF^s +rrFplain) r mako.cacherr mako.templater assertionsrrr rFrBrrrr]sA &"QCQChY2#34r