
    ;e                     T   d dl Z d dlZd dlmZ  G d d          Z G d de          Z G d de          Z G d	 d
e          Z G d de          Z	 G d de          Z
 G d de          Z G d de          Z G d dej                  Zedk    r ej                     dS dS )    N)ExtensionSaverc                       e Zd ZdS )CN__name__
__module____qualname__     (/usr/lib/python3.11/test/test_copyreg.pyr   r              Dr   r   c                       e Zd ZdS )WithoutSlotsNr   r
   r   r   r   r   
   r   r   r   c                       e Zd ZdZdS )WithWeakref)__weakref__Nr   r   r	   	__slots__r
   r   r   r   r      s         IIIr   r   c                       e Zd ZdZdS )WithPrivate__spamNr   r
   r   r   r   r              IIIr   r   c                       e Zd ZdZdS ) _WithLeadingUnderscoreAndPrivater   Nr   r
   r   r   r   r      r   r   r   c                       e Zd ZdZdS )___r   Nr   r
   r   r   r   r      r   r   r   c                       e Zd ZdZdS )WithSingleStringspamNr   r
   r   r   r   r      s        IIIr   r   c                       e Zd ZdZdS )WithInherited)eggsNr   r
   r   r   r"   r"      s        IIIr   r"   c                   2    e Zd Zd Zd Zd Zd Zd Zd ZdS )CopyRegTestCasec                 `    |                      t          t          j        t          d d            d S )N)assertRaises	TypeErrorcopyregpickler   selfs    r   
test_classzCopyRegTestCase.test_class"   s1    )W^T4	) 	) 	) 	) 	)r   c                 n    |                      t          t          j        t	          d          d           d S N   znot a callable)r'   r(   r)   r*   typer+   s    r   test_noncallable_reducez'CopyRegTestCase.test_noncallable_reduce&   s6    )W^q''#3	5 	5 	5 	5 	5r   c                 z    |                      t          t          j        t	          d          t
          d           d S r/   )r'   r(   r)   r*   r1   intr+   s    r   test_noncallable_constructorz,CopyRegTestCase.test_noncallable_constructor*   s8    )W^q''3(8	: 	: 	: 	: 	:r   c                 `    dd l }|                     d|                     d                     d S )Nr   T)copyassertEqual)r,   r7   s     r   	test_boolzCopyRegTestCase.test_bool.   s1    tyy/////r   c                 `   d\  }}}t          |          }	 |                     t          t          j        |||           t          j        |||           |                     t          j        ||f         |k               |                     t          j        |         ||fk               | 	                    |t          j
                   t          j        |||           |                     t          t          j        |||dz              |                     t          t          j        |||dz              |                     t          t          j        |dd          ||           |                     t          t          j        |dd          ||           |                     t          t          j        ||dd          |           |                     t          t          j        ||dd          |           |dz   t          j        vr;|                     t          t          j        |dd          |dd          |dz              |                                 n# |                                 w xY w| 	                    ||ft          j                   dD ]k}t          |          }	 t          j        |||           t          j        |||           |                                 S# |                                 w xY wdD ]*}|                     t          t          j        |||           +d S )N)zjunk1 z junk2iͫ  r0   )r0   i)r   l        )r   r'   
ValueErrorr)   remove_extensionadd_extension
assertTrue_extension_registry_inverted_registryassertNotIn_extension_cacherestore)r,   modfunccodees        r   test_extension_registryz'CopyRegTestCase.test_extension_registry2   s"   4T44  !	j'*B!4/ / /!#tT222OOG7T	BdJKKKOOG6t<dKLLLT7#;<<<!#tT222j'*?!43 3 3j'*B!43 3 3 j'*?!!""gtT4 4 4j'*B!!""gtT4 4 4 j'*?!48T3 3 3j'*B!48T3 3 3 axw999!!*g.F"%abb'48TAX? ? ? IIKKKKAIIKKKK 	#tg&ABBB " 	 	Dt$$A%c4666(dD999				 & 	/ 	/Dj'*?!4/ / / /	/ 	/s   H,I I.',K((K>c                    |                      t          j        t                    g            |                      t          j        t                    g            dg}|                      t          j        t
                    |           dg}|                      t          j        t                    |           |                      t          j        t                    dg           |                      t          j        t                    dg           ddg}|	                                 t          j        t                    }|	                                 |                      ||           d S )N_WithPrivate__spam&_WithLeadingUnderscoreAndPrivate__spamr   r    r#   )r8   r)   
_slotnamesr   r   r   r   r   r   sortr"   )r,   expectedresults      r   test_slotnameszCopyRegTestCase.test_slotnamesl   s5   +L992>>>+K88"===()+K88(CCC<=+,LMM!	# 	# 	#+C008*===+,<==xHHHF##M22*****r   N)	r   r   r	   r-   r2   r5   r9   rI   rQ   r
   r   r   r%   r%       so        ) ) )5 5 5: : :0 0 08/ 8/ 8/t+ + + + +r   r%   __main__)r)   unittesttest.pickletesterr   r   objectr   r   r   r   r   r   r"   TestCaser%   r   mainr
   r   r   <module>rX      s     , , , , , ,	 	 	 	 	 	 	 		 	 	 	 	6 	 	 	! ! ! ! !& ! ! !    &       v       &       v       $   Z+ Z+ Z+ Z+ Z+h' Z+ Z+ Z+z zHMOOOOO r   