ryUddlZddlmZddlmZddlmZddlmZddlmZGdd Z Gd d eZ ed e d dS) N) CacheImpl)register_plugin)Template)eq_)configcJeZdZdZdZ d dZ d dZ d dZdZdS) TemplateTestc `||}td||tjd|S)N)urifilenamemodule_directory) _file_pathrr module_base)selfr kwfilepaths /srv/buildsys-work-dir/castor/build_node/builder-2/WGSG1/unpkd_srcs/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/mako/testing/fixtures.py_file_templatezTemplateTest._file_template sE??8,, #/      c<tj|\}}tjtj|dz|z}tj|r|Stjtj|S)N_py3k)ospathsplitextjoinr template_baseexists)rr nameext py3k_paths rrzTemplateTest._file_pathsqG$$X.. cGLL!5tg~7KLL 7>>) $ $  w||F0(;;;rNTc V|j|fi|}||||||dS)Nfiltersunicode_ template_args)r_do_test)rr expectedr%r&r'rt1s r _do_file_testzTemplateTest._do_file_testsR!T  0 0R 0 0  '      rc Vtdd|i|}||||||dS)Ntextr$r)rr()rsourcer)r%r&r'rr*s r_do_memory_testzTemplateTest._do_memory_test.sP ( (6 (R ( (  '      rc|i}|r|jdi|}n |jdi|}|r ||}t||dSNr)render_unicoderenderr)rtemplater)r%r'r&outputs rr(zTemplateTest._do_test@ss  M  6,X,==}==FF$X_55}55F  %WV__F FHrc^d|d}d|dd|df}tfd|DS)Nz'zlocal variable z referenced before assignmentzcannot access local variable z where it is not associatedc3 K|]}|vV dSNr).0msgrendered_outputs r z=TemplateTest.indicates_unbound_local_error..[s(BBC?*BBBBBBr)any)rr; unbound_varvar error_msgss ` rindicates_unbound_local_errorz*TemplateTest.indicates_unbound_local_errorSs^(k((( Ac @ @ @ LC L L L  BBBBzBBBBBBr)NTN)NNT) __name__ __module__ __qualname__rrr+r/r(rArrrr r s   <<<     ,     , &CCCCCrr c0eZdZdZdZdZdZdZdZdS)PlainCacheImplzTSimple memory cache impl so that tests which use caching can run without beaker.c"||_i|_dSr8)cachedata)rrHs r__init__zPlainCacheImpl.__init__bs  rc V||jvr |j|S|di|x|j|<}|Sr1rI)rkeycreation_functionrrIs r get_or_createzPlainCacheImpl.get_or_createfsA $)  9S> !$5$5$;$;$;$; ;DIcNTKrc ||j|<dSr8rL)rrMvaluers rputzPlainCacheImpl.putms #rc |j|Sr8rLrrMrs rgetzPlainCacheImpl.getpsy~rc |j|=dSr8rLrTs r invalidatezPlainCacheImpl.invalidatess IcNNNrN) rBrCrD__doc__rJrOrRrUrWrrrrFrF^si++rrFplain) r mako.cacherr mako.templater assertionsrrr rFrBrrrr]s &&&&&&""""""QCQCQCQCQCQCQCQChY2#344444r