| Server IP : 3.111.61.48 / Your IP : 216.73.216.67 Web Server : Apache System : Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64 User : ubuntu ( 1000) PHP Version : 8.2.31 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/lib/python3.10/test/__pycache__/ |
Upload File : |
o
�9j�2 � @ s� d dl Z d dlZd dlZd dlmZ d dlmZ d dlm Z d dl
mZ eddd�Zd Z
G d
d� dej�ZG dd
� d
ej�ZG dd� de�ZG dd� de�ZG dd� de j�ZG dd� dej�Zedkrje�� dS dS )� N)�AttributesImpl)�feature_external_ges)�pulldom)�findfileztest.xml�xmltestdata)�subdira
<?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 @ sP e Zd Zdd� Zdd� Zdd� Zejdd� �Zejd d
� �Z dd� Z
d
d� ZdS )�PullDOMTestCasec C s^ t �t�}| �|jj� t|� ttd��}tt �|�� W d � dS 1 s(w Y dS )z&Minimal test of DOMEventStream.parse()�rbN)r �parse�tstfile�
addCleanup�stream�close�list�open)�self�handler�fin� r �(/usr/lib/python3.10/test/test_pulldom.py�
test_parse s
"�zPullDOMTestCase.test_parsec C s� t �t�}t|�\}}| �t|d�� | �t j|� t|�\}}| �t j|� | �d|j � | �dt
|j�� | �|j�d�j
d� t|�\}}| �t j|� t|�\}}| �t j|� t|�\}}| �d|j � |}t|�\}}| �t j|� | �d|j� t|�\}}| �t j|� | �d|j � | �||u � t|�\}}| �t j|� t|�\}}| �t j|� | �d|j � t|�\}}| �t j|� | �d|j � t|�\}}| �t j|� t|�\}}| �t j|� | �d |j � t|�\}}| �t j|� | �d
|j � t|�\}}| �t j|� t|�\}}| �t j|� | �d
|j � t|�\}}| �t j|� t|�\}}| �t j|� t|�\}}| �t j|� dS )z&Test DOMEventStream parsing semantics.�
createElement�html� z xmlns:xdczhttp://www.xml.com/books�titlezIntroduction to XSL�hr�pz
xdc:authorN)r �parseString�SMALL_SAMPLE�next�
assertTrue�hasattr�assertEqual�START_DOCUMENT�
START_ELEMENT�tagName�len�
attributes�getNamedItem�value�
CHARACTERS�data�END_ELEMENT)r �items�evt�node�
title_noder r r �test_parse_semantics+ sh
�z$PullDOMTestCase.test_parse_semanticsc C s> t �t�}|D ]\}}|t jkr%|jdkr%|�|� | �dt|j�� nq| � d� |D ]\}}|t jkr8 nq-| �d|jd� |�|� | �t
|�d t j� t
|�\}}| �|jd� |�|� t
|� t
|�\}}| �|jd� | �t
�� t
|� W d � n1 s�w Y |�� | �|j� | �|j� d S )
z$Ensure expandItem works as expected.r � z,No "title" element detected in SMALL_SAMPLE!r z=expandNode did not leave DOMEventStream in the correct state.r r r N)r r r r$ r% �
expandNoder"