Sindbad~EG File Manager
�
'ΜgT1 � �f � d dl Z d dlZd dlZd dlmZ d dlmZ d dlm Z d dl
mZ edd�� Zd Z
G d
� dej � Z G d� d
ej � Z G d� de� Z G d� de� Z G d� de j( � Z G d� dej � Zedk( r ej0 � yy)� 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 �l � e Zd Zd� Zd� Zd� Zej d� � Zej d� � Z d� Z
y)�PullDOMTestCasec � � t j t � }| j |j j
� t
|� t t d� 5 }t
t j |� � ddd� y# 1 sw Y yxY w)z&Minimal test of DOMEventStream.parse()�rbN)r �parse�tstfile�
addCleanup�stream�close�list�open)�self�handler�fins �./usr/local/lib/python3.12/test/test_pulldom.py�
test_parsezPullDOMTestCase.test_parse sZ � � �-�-��(��������,�,�-��W�
� �'�4�
�C�����s�#�$� !�
�
�s �B�Bc �z � t j t � }t |� \ }}| j t |d� � | j
t j |� t |� \ }}| j
t j |� | j
d|j � | j
dt |j � � | j
|j j d� j d� t |� \ }}| j
t j |� t |� \ }}| j
t j |� t |� \ }}| j
d|j � |}t |� \ }}| j
t j |� | j
d|j � t |� \ }}| j
t j |� | j
d|j � | j ||u � t |� \ }}| j
t j |� t |� \ }}| j
t j |� | j
d|j � t |� \ }}| j
t j |� | j
d|j � t |� \ }}| j
t j |� t |� \ }}| j
t j |� | j
d |j � t |� \ }}| j
t j |� | j
d
|j � t |� \ }}| j
t j |� t |� \ }}| j
t j |� | j
d
|j � t |� \ }}| j
t j |� t |� \ }}| j
t j |� t |� \ }}| j
t j |� y)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_nodes r �test_parse_semanticsz$PullDOMTestCase.test_parse_semantics+ s� � � �#�#�L�1����K� ��T������o�6�7�����/�/��5���K� ��T�����.�.��4��������.�����C����0�1�������5�5�k�B�H�H�(� *���K� ��T�����+�+�S�1���K� ��T�
����+�+�S�1���K� ��T�����$�,�,�/��
���K� ��T�����+�+�S�1����.�� � �:���K� ��T�����,�,�c�2�����$�,�,�/����
�d�*�+���K� ��T�����+�+�S�1���K� ��T�����.�.��4�����t�|�|�,���K� ��T�����,�,�c�2�����t�|�|�,���K� ��T�����+�+�S�1���K� ��T�����.�.��4�����d�l�l�+���K� ��T�����.�.��4�����t�|�|�4���K� ��T�����+�+�S�1���K� ��T�����,�,�c�2�����t�|�|�4���K� ��T�����,�,�c�2���K� ��T�����+�+�S�1���K� ��T�����,�,�c�2� c �� � t j t � }|D ]` \ }}|t j k( s�|j dk( s�*|j |� | j
dt |j � � n | j d� |D ] \ }}|t j k( s� n | j
dj d� |j |� | j
t |� d t j � t |� \ }}| j
|j d� |j |� t |� t |� \ }}| j
|j d� | j t � 5 t |� d d d � |j � | j |j � | j |j"