HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib/python3/dist-packages/twisted/web/test/__pycache__/test_stan.cpython-38.pyc
U


W[#�@s`dZddlmZmZddlmZmZmZmZddl	m
Z
ddlmZdd�Z
Gdd	�d	e
�Zd
S)zW
Tests for L{twisted.web._stan} portion of the L{twisted.web.template}
implementation.
�)�absolute_import�division)�Comment�CDATA�CharRef�Tag)�TestCase)�_PY3cOstd�||�S)z(
    Produce a new tag for testing.
    �hello)r)�a�kw�r
�</usr/lib/python3/dist-packages/twisted/web/test/test_stan.py�protosrc@s~eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Ze
sfde_de_nde	_de
_dd�ZdS)�TagTestsz
    Tests for L{Tag}.
    cCst�}|�||jdd��dS)z0
        L{Tag.fillSlots} returns self.
        �test)rN)r�assertIdentical�	fillSlots��self�tagr
r
r�test_fillSlotsszTagTests.test_fillSlotscCs�dg}td|ddd�}|jdd�d|_d	|_d
|_|jdd�}|�|jd
d�|�|j|j�|�|j	d|g�|�|j	|j	�|�
|j	d|�|�|j|j�|�|j|j�|�|jd�|�|jd	�|�|jd
�|�|jd�dS)z�
        L{Tag.clone} copies all attributes and children of a tag, including its
        render attribute.  If the shallow flag is C{False}, that's where it
        stops.
        �
inner list�How are you�world�
aSampleMethod�r
�render�bar�Zfoo�foo/bar��F)Zdeepr
�N�
rr�filenameZ
lineNumberZcolumnNumber�clone�assertEqual�
attributesZassertNotIdentical�childrenrZslotDatar)r�	innerListrr&r
r
r�test_cloneShallow"s*�zTagTests.test_cloneShallowcCstd�}dg}td||ddd�}|jdd�d	|_d
|_d|_|��}|�|jdd�|�|j|j�|�|j	|j	�|�
|j	d
|�|�|j	d
|�|�
|j	d|�|�|j	d|�|�|j|j�|�|j|j�|�|jd	�|�|jd
�|�|jd�|�|jd�dS)z�
        L{Tag.clone} copies all attributes and children of a tag, including its
        render attribute.  In its normal operating mode (where the deep flag is
        C{True}, as is the default), it will clone all sub-lists and sub-tags.
        �innerrrrrrrrr r!r"r
r#�Nr$)rZinnerTagr*rr&r
r
r�test_cloneDeep=s0�zTagTests.test_cloneDeepcCs<tddddd�}|��|�|jg�|�|jddi�dS)zk
        L{Tag.clear} removes all children from a tag, but leaves its attributes
        in place.
        z	these arer)Zcoolzthis-attribute)�andSoIsr/N)r�clearr'r)r(rr
r
r�
test_clear_szTagTests.test_clearcCs.td�}|�}|dd�|�|jddi�dS)z�
        L{Tag.__call__} accepts Python keywords with a suffixed underscore as
        the DOM attribute of that literal suffix.
        Zdivr)Zclass_�classN)rr'r()rrrr
r
r�test_suffixjs
zTagTests.test_suffixcCs|�ttd��d�dS)�o
        L{Comment.__repr__} returns a value which makes it easy to see what's
        in the comment.
        �hello therezComment(u'hello there')N�r'�reprr�rr
r
r�test_commentReprPy2us�zTagTests.test_commentReprPy2cCs|�ttd��d�dS)�m
        L{CDATA.__repr__} returns a value which makes it easy to see what's in
        the comment.
        �	test datazCDATA(u'test data')N�r'r7rr8r
r
r�test_cdataReprPy2~s�zTagTests.test_cdataReprPy2cCs|�ttd��d�dS)r4r5zComment('hello there')Nr6r8r
r
r�test_commentReprPy3�s�zTagTests.test_commentReprPy3cCs|�ttd��d�dS)r:r;zCDATA('test data')Nr<r8r
r
r�test_cdataReprPy3�s�zTagTests.test_cdataReprPy3zOnly relevant on Python 3.zOnly relevant on Python 2.cCs td�}|�tt|��d�dS)zw
        L{CharRef.__repr__} returns a value which makes it easy to see what
        character is referred to.
        u☃z
CharRef(9731)N)�ordr'r7r)rZsnowmanr
r
r�test_charrefRepr�szTagTests.test_charrefReprN)�__name__�
__module__�__qualname__�__doc__rr+r.r1r3r9r=r>r?r	�skiprAr
r
r
rrs "			rN)rEZ
__future__rrZtwisted.web.templaterrrrZtwisted.trial.unittestrZtwisted.python.compatr	rrr
r
r
r�<module>s