o
    KXîh¨  ã                   @   sn   d dl Z G dd„ deƒZG dd„ deƒZG dd„ de jƒZG dd	„ d	eƒZG d
d„ deƒZG dd„ deƒZdS )é    Nc                   @   s    e Zd ZdZdd„ Zdd„ ZdS )ÚTestEqualityúUsed as a mixin for TestCasec                 C   ó,   | j D ]\}}|  ||¡ |  ||¡ qd S ©N)Úeq_pairsZassertEqual©ÚselfÚobj_1Úobj_2© r   ú?/opt/python-3.10.19/usr/lib/python3.10/unittest/test/support.pyÚtest_eq   ó   þzTestEquality.test_eqc                 C   r   r   )Úne_pairsZassertNotEqualr   r   r   r   Útest_ne   r   zTestEquality.test_neN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r      s    r   c                   @   s   e Zd ZdZdd„ ZdS )ÚTestHashingr   c                 C   sà   | j D ]3\}}zt|ƒt|ƒks|  d||f ¡ W q ty6 } z|  d|||f ¡ W Y d }~qd }~ww | jD ]3\}}zt|ƒt|ƒkrP|  d||f ¡ W q: tym } z|  d|||f ¡ W Y d }~q:d }~ww d S )Nz%r and %r do not hash equalzProblem hashing %r and %r: %sz#%s and %s hash equal, but shouldn'tzProblem hashing %s and %s: %s)r   ÚhashZfailÚ	Exceptionr   )r   r	   r
   Úer   r   r   Ú	test_hash   s*   € €ÿÿ€ €ÿûzTestHashing.test_hashN)r   r   r   r   r   r   r   r   r   r      s    r   c                       s”   e Zd Z‡ fdd„Z‡ fdd„Z‡ fdd„Z‡ fdd„Z‡ fd	d
„Z‡ fdd„Z‡ fdd„Z	‡ fdd„Z
‡ fdd„Z‡ fdd„Z‡ fdd„Z‡  ZS )Ú_BaseLoggingResultc                    s   || _ tƒ  ¡  d S r   )Ú_eventsÚsuperÚ__init__)r   Úlog©Ú	__class__r   r   r   )   s   z_BaseLoggingResult.__init__c                    ó   | j  d¡ tƒ  |¡ d S )NÚ	startTest)r   Úappendr   r"   ©r   Útestr   r   r   r"   -   ó   z_BaseLoggingResult.startTestc                    ó   | j  d¡ tƒ  ¡  d S )NÚstartTestRun)r   r#   r   r(   ©r   r   r   r   r(   1   ó   z_BaseLoggingResult.startTestRunc                    r!   )NÚstopTest)r   r#   r   r+   r$   r   r   r   r+   5   r&   z_BaseLoggingResult.stopTestc                    r'   )NÚstopTestRun)r   r#   r   r,   r)   r   r   r   r,   9   r*   z_BaseLoggingResult.stopTestRunc                    ó   | j  d¡ tƒ j|Ž  d S )NÚ
addFailure)r   r#   r   r.   ©r   Úargsr   r   r   r.   =   r&   z_BaseLoggingResult.addFailurec                    r-   )NÚ
addSuccess)r   r#   r   r1   r/   r   r   r   r1   A   r&   z_BaseLoggingResult.addSuccessc                    r-   )NÚaddError)r   r#   r   r2   r/   r   r   r   r2   E   r&   z_BaseLoggingResult.addErrorc                    r-   )NÚaddSkip)r   r#   r   r3   r/   r   r   r   r3   I   r&   z_BaseLoggingResult.addSkipc                    r-   )NÚaddExpectedFailure)r   r#   r   r4   r/   r   r   r   r4   M   r&   z%_BaseLoggingResult.addExpectedFailurec                    r-   )NÚaddUnexpectedSuccess)r   r#   r   r5   r/   r   r   r   r5   Q   r&   z'_BaseLoggingResult.addUnexpectedSuccess)r   r   r   r   r"   r(   r+   r,   r.   r1   r2   r3   r4   r5   Ú__classcell__r   r   r   r   r   (   s    r   c                   @   s   e Zd ZdZedd„ ƒZdS )ÚLegacyLoggingResultzo
    A legacy TestResult implementation, without an addSubTest method,
    which records its method calls.
    c                 C   s   t ‚r   )ÚAttributeErrorr)   r   r   r   Ú
addSubTest\   s   zLegacyLoggingResult.addSubTestN)r   r   r   r   Úpropertyr9   r   r   r   r   r7   V   s    r7   c                       s    e Zd ZdZ‡ fdd„Z‡  ZS )ÚLoggingResultzE
    A TestResult implementation which records its method calls.
    c                    s6   |d u r| j  d¡ n| j  d¡ tƒ  |||¡ d S )NZaddSubTestSuccessZaddSubTestFailure)r   r#   r   r9   )r   r%   ZsubtestÚerrr   r   r   r9   f   s   zLoggingResult.addSubTest)r   r   r   r   r9   r6   r   r   r   r   r;   a   s    r;   c                   @   sH   e Zd ZdZdd„ Zdd„ Zdd„ Zdd	„ Zd
d„ Zdd„ Z	dd„ Z
dS )Ú#ResultWithNoStartTestRunStopTestRunz?An object honouring TestResult before startTestRun/stopTestRun.c                 C   s.   g | _ g | _d| _g | _g | _g | _d| _d S )Nr   F)ZfailuresÚerrorsZtestsRunZskippedZexpectedFailuresZunexpectedSuccessesZ
shouldStopr)   r   r   r   r   q   s   
z,ResultWithNoStartTestRunStopTestRun.__init__c                 C   ó   d S r   r   r$   r   r   r   r"   z   ó   z-ResultWithNoStartTestRunStopTestRun.startTestc                 C   r?   r   r   r$   r   r   r   r+   }   r@   z,ResultWithNoStartTestRunStopTestRun.stopTestc                 C   r?   r   r   r$   r   r   r   r2   €   r@   z,ResultWithNoStartTestRunStopTestRun.addErrorc                 C   r?   r   r   r$   r   r   r   r.   ƒ   r@   z.ResultWithNoStartTestRunStopTestRun.addFailurec                 C   r?   r   r   r$   r   r   r   r1   †   r@   z.ResultWithNoStartTestRunStopTestRun.addSuccessc                 C   s   dS )NTr   r)   r   r   r   ÚwasSuccessful‰   r@   z1ResultWithNoStartTestRunStopTestRun.wasSuccessfulN)r   r   r   r   r   r"   r+   r2   r.   r1   rA   r   r   r   r   r=   n   s    	r=   )	ZunittestÚobjectr   r   Z
TestResultr   r7   r;   r=   r   r   r   r   Ú<module>   s    .