
    daf                         d dl Z d dlZd dlZd dlZd dl  G d dej                        Z G d dej                        Ze	dk(  r ej                          yy)    N)*c                   (    e Zd ZdZd Zd Zd Zd Zy)EmptyNodeListTestCasez"Tests for the EmptyNodeList class.c                 T   t               }| j                  |j                  d             | j                  |j                  d             | j                  t              5  |d    d d d        | j                  t              5  |d    d d d        y # 1 sw Y   -xY w# 1 sw Y   y xY w)Nr   )EmptyNodeListassertIsNoneitemassertRaises
IndexErrorself	node_lists     7/root/Python-3.12.4/Lib/test/test_xml_dom_minicompat.pytest_emptynodelist_itemz-EmptyNodeListTestCase.test_emptynodelist_item   s    !O	)..+,)..,-z* 	aL	z* 	bM	 		 		 	s    BBBB'c                     t               }| j                  |j                  d       | j                  t        j
                  j                        5  d|_        d d d        y # 1 sw Y   y xY w)Nr   o   )r   assertEquallengthr   xmldomNoModificationAllowedErrr   s     r   test_emptynodelist_lengthz/EmptyNodeListTestCase.test_emptynodelist_length   sT    !O	))1-sww??@ 	#"I	# 	# 	#s   A!!A*c                 b    t               t               z   }| j                  |t                      y )N)r   NodeListr   r   s     r   test_emptynodelist___add__z0EmptyNodeListTestCase.test_emptynodelist___add__"   s"    !Ohj0	HJ/    c                 J    ddgt               z   }| j                  |ddg       y N      )r   r   r   s     r   test_emptynodelist___radd__z1EmptyNodeListTestCase.test_emptynodelist___radd__&   s&    qEMO+	QqE*r   N)__name__
__module____qualname____doc__r   r   r   r"    r   r   r   r      s    ,
#0+r   r   c                   :    e Zd ZdZd Zd Zd Zd Zd Zd Z	d Z
y	)
NodeListTestCasezTests for the NodeList class.c                 n   t               }| j                  |j                  d             | j                  |j                  d             | j                  t              5  |d    d d d        | j                  t              5  |d    d d d        |j                  d       |j                  d       | j                  |j                  d      d       | j                  |j                  d             | j                  |d   d       | j                  |d   d       y # 1 sw Y   xY w# 1 sw Y   xY w)Nr   r   r   i  )r   r	   r
   r   r   appendr   r   s     r   test_nodelist_itemz#NodeListTestCase.test_nodelist_item.   s    J	)..+,)..,-z* 	aL	z* 	bM	 	*C0)..,-1s+2,	 		 	s    DD+D(+D4c                     t        ddg      }| j                  |j                  d       | j                  t        j
                  j                        5  d|_        d d d        y # 1 sw Y   y xY w)Nr    r!   r   )r   r   r   r   r   r   r   r   s     r   test_nodelist_lengthz%NodeListTestCase.test_nodelist_lengthE   s[    aV$	))1-sww??@ 	#"I	# 	# 	#s   A$$A-c                 b    t        ddg      ddgz   }| j                  |t        g d             y )N      r    r!   )r0   r1   r    r!   r   r   r   s     r   test_nodelist___add__z&NodeListTestCase.test_nodelist___add__M   s.    aV$1v-	H\$:;r   c                 b    ddgt        ddg      z   }| j                  |t        g d             y )Nr    r!   r0   r1   )r    r!   r0   r1   r2   r   s     r   test_nodelist___radd__z'NodeListTestCase.test_nodelist___radd__Q   s.    FXq!f--	H\$:;r   c                    t        t        j                  dz         D ]  }t               }t        j                  ||      }t        j
                  |      }| j                  ||       | j                  ||       |j                  d       |j                  d       t        j                  ||      }t        j
                  |      }| j                  ||       | j                  ||        y r   )	rangepickleHIGHEST_PROTOCOLr   dumpsloadsassertIsNotr   r+   )r   protor   pickled	unpickleds        r   test_nodelist_pickle_roundtripz/NodeListTestCase.test_nodelist_pickle_roundtripU   s     622Q67 	3E 
Ill9e4GW-IY	2Y	2 QQll9e4GW-IY	2Y	2	3r   c                    t               }t        j                  |      }| j                  ||       | j                  ||       |j	                  dg       |j	                  dg       t        j                  |      }| j                  ||       | j                  ||       t        ||      D ]  \  }}| j                  ||        y r   )r   copyr<   r   r+   zipassertIsr   r   copiedxys        r   test_nodelist_copyz#NodeListTestCase.test_nodelist_copyh   s    J	9%++ 	!!9%++	* 	 DAqMM!Q	 r   c                    t               }t        j                  |      }| j                  ||       | j	                  ||       |j                  dg       |j                  dg       t        j                  |      }| j                  ||       | j	                  ||       t        ||      D ])  \  }}| j                  ||       | j	                  ||       + y r   )r   rB   deepcopyr<   r   r+   rC   rE   s        r   test_nodelist_deepcopyz'NodeListTestCase.test_nodelist_deepcopyx   s    J	y)++ 	!!y)++	* 	#DAqQ"Q"	#r   N)r#   r$   r%   r&   r,   r.   r3   r5   r@   rI   rL   r'   r   r   r)   r)   +   s(    '-.#<<3&  #r   r)   __main__)rB   r8   unittestxml.domr   xml.dom.minicompatTestCaser   r)   r#   mainr'   r   r   <module>rS      sX         +H-- +@\#x(( \#| zHMMO r   