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__/text.cpython-310.pyc
o

!�b�"�@s�ddlZddlZddlZddlZddlZddlmZddlmZddl	m
Z
mZGdd�dej�Z
Gdd�dej�Zd	d
�ZedkrJejd
d�dSdS)
�N)�TemplateSyntaxError)�TemplateLoader)�OldTextTemplate�NewTextTemplatec@sheZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)�OldTextTemplateTestCase�#Tests for text template processing.cC�tjdd�|_dS�N�markup_test)�suffix��tempfile�mkdtemp�dirname��self�r�</usr/lib/python3/dist-packages/genshi/template/tests/text.py�setUp�zOldTextTemplateTestCase.setUpcC�t�|j�dS�N��shutil�rmtreerrrrr�tearDown�z OldTextTemplateTestCase.tearDowncC�$td�}|�d|��jdd��dS)Nz	\#escapedz#escaped��encoding�r�assertEqual�generate�render�r�tmplrrr�
test_escaping"�z%OldTextTemplateTestCase.test_escapingcCr)Nz## a comment�rr r$rrr�test_comment&r'z$OldTextTemplateTestCase.test_commentcCr)Nz\## escaped commentz## escaped commentrr r$rrr�test_comment_escaping*��z-OldTextTemplateTestCase.test_comment_escapingcC�(td�}|�d|jdd�jdd��dS)Nz4
        #if foo
          bar
        #end 'if foo'�
F��foorr r$rrr�test_end_with_args/� z*OldTextTemplateTestCase.test_end_with_argscC�8d�d�}t|dd�}|�d|jddd�jdd��dS�N�
$fooö$barz
iso-8859-1r�xöy�x�y�r/�bar)�encoderr!r"r#�r�textr%rrr�test_latin1_encoded6�

�z+OldTextTemplateTestCase.test_latin1_encodedcC�.d}t|�}|�d|jddd�jdd��dS�Nr4r5r6r7r8rr r;rrr�test_unicode_input<�
�z*OldTextTemplateTestCase.test_unicode_inputcC�,td�}|�d|jtd�d�jdd��dS)NzHYour items:

        #for item in items
          * ${item}
        #endz7Your items:

          * 0
          * 1
          * 2
���itemsr�rr!r"�ranger#r$rrr�test_empty_lines1B��z)OldTextTemplateTestCase.test_empty_lines1cCrC)NzIYour items:

        #for item in items
          * ${item}

        #endz:Your items:

          * 0

          * 1

          * 2

rDrErrGr$rrr�test_empty_lines2O��z)OldTextTemplateTestCase.test_empty_lines2cC�ttj�|jd�d�}z|�d�d��W|��n|��wttj�|jd�d�}z|�d�d��W|��n|��wt|jg�}|j	dt
d�}|�d|��j
dd	��dS)
N�	tmpl1.txt�wbz	Included
�utf-8�	tmpl2.txtz~----- Included data below this line -----
            #include tmpl1.txt
            ----- Included data above this line -----��clszh----- Included data below this line -----
Included
            ----- Included data above this line -----r)�open�os�path�joinr�writer:�closer�loadrr!r"r#�r�file1�file2�loaderr%rrr�test_include`���z$OldTextTemplateTestCase.test_includeN)�__name__�
__module__�__qualname__�__doc__rrr&r)r*r0r=rArIrKr_rrrrrs
rc@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$S)%�NewTextTemplateTestCasercCrr	rrrrrrzrzNewTextTemplateTestCase.setUpcCrrrrrrrr}rz NewTextTemplateTestCase.tearDowncCr)Nz\{% escaped %}z
{% escaped %}r�rr!r"r#r$rrrr&�r+z%NewTextTemplateTestCase.test_escapingcCr)Nz{# a comment #}r(rrfr$rrrr)�r'z$NewTextTemplateTestCase.test_commentcCr)Nz\{# escaped comment #}z{# escaped comment #}rrfr$rrrr*�r+z-NewTextTemplateTestCase.test_comment_escapingcCr,)Nz&
{% if foo %}
  bar
{% end 'if foo' %}r-Fr.rrfr$rrrr0�r1z*NewTextTemplateTestCase.test_end_with_argscCr2r3)r:rr!r"r#r;rrrr=�r>z+NewTextTemplateTestCase.test_latin1_encodedcCr?r@rfr;rrrrA�rBz*NewTextTemplateTestCase.test_unicode_inputcCrC)Nz9Your items:

{% for item in items %}  * ${item}
{% end %}zYour items:

  * 0
  * 1
  * 2
rDrEr�rr!r"rHr#r$rrrrI�rJz)NewTextTemplateTestCase.test_empty_lines1cCrC)Nz?Your items:

{% for item in items %}\
  * ${item}
{% end %}z$Your items:

  * 0
  * 1
  * 2
rDrErrgr$rrr�test_empty_lines1_with_crlf�s�z3NewTextTemplateTestCase.test_empty_lines1_with_crlfcCrC)Nz:Your items:

{% for item in items %}  * ${item}

{% end %}z"Your items:

  * 0

  * 1

  * 2

rDrErrgr$rrrrK�rLz)NewTextTemplateTestCase.test_empty_lines2cCrC)NzAYour items:

{% for item in items %}\
  * ${item}

{% end %}z*Your items:

  * 0

  * 1

  * 2

rDrErrgr$rrr�test_empty_lines2_with_crlf�s�z3NewTextTemplateTestCase.test_empty_lines2_with_crlfcCstd�dS)zw
        Verify that a code block with trailing space does not cause a syntax
        error (see ticket #127).
        z?
          {% python
            bar = 42
          $}
        N)rrrrr�test_exec_with_trailing_space�sz5NewTextTemplateTestCase.test_exec_with_trailing_spacecCr)NzQ{% python from datetime import timedelta %}
        ${timedelta(days=2)}
        z!
        2 days, 0:00:00
        rrfr$rrr�test_exec_import�s�z(NewTextTemplateTestCase.test_exec_importcCr)NzW{% python
        def foo():
            return 42
        %}
        ${foo()}
        z
        42
        rrfr$rrr�
test_exec_def�s�z%NewTextTemplateTestCase.test_exec_defcCrM)
NrNrO�IncludedrPrQzk----- Included data below this line -----
{% include tmpl1.txt %}
----- Included data above this line -----rRz\----- Included data below this line -----
Included
----- Included data above this line -----r�rTrUrVrWrrXr:rYrrZrr!r"r#r[rrrr_�r`z$NewTextTemplateTestCase.test_includecCrM)
NrNrOrmrPrQz�----- Included data below this line -----
    {% include ${'%s.txt' % ('tmpl1',)} %}
    ----- Included data above this line -----rRzd----- Included data below this line -----
    Included
    ----- Included data above this line -----rrnr[rrr�test_include_exprr`z)NewTextTemplateTestCase.test_include_exprN)rarbrcrdrrr&r)r*r0r=rArIrhrKrirjrkrlr_rorrrrrews&

recCsBt��}|�t�tj��|�t�td��|�t�t	d��|S)N�test)
�unittest�	TestSuite�addTest�doctest�DocTestSuiterrb�	makeSuiterre)�suiterrrrw's
rw�__main__)�defaultTest)rtrUrr
rq�genshi.template.baser�genshi.template.loaderr�genshi.template.textrr�TestCaserrerwra�mainrrrr�<module>s
^1�

https://t.me/RX1948 - 2025