
    (ph-                         S r SSKrS r " S S\R                  5      r " S S\R                  5      rS r " S	 S
\R                  5      r " S S\R                  5      rg)z%zope.interface.exceptions unit tests
    Nc                  (    SSK Jn    " S SU 5      nU$ )Nr   )	Interfacec                       \ rS rSrSrg)_makeIface.<locals>.IDummy    N)__name__
__module____qualname____firstlineno____static_attributes__r       W/var/www/html/venv/lib/python3.13/site-packages/zope/interface/tests/test_exceptions.pyIDummyr      s    r   r   )zope.interfacer   )r   r   s     r   
_makeIfacer      s    (  Mr   c                   ,    \ rS rSrS rS rS rS rSrg)DoesNotImplementTests   c                     SSK Jn  U$ )Nr   )DoesNotImplement)zope.interface.exceptionsr   )selfr   s     r   _getTargetClass%DoesNotImplementTests._getTargetClass   s    >r   c                 D    [        5       nU R                  5       " U/UQ76 $ )Nr   r   r   argsifaces      r   _makeOneDoesNotImplementTests._makeOne"   s"    ##%e3d33r   c                 Z    U R                  5       nU R                  [        U5      S5        g )NzAn object has failed to implement interface zope.interface.tests.test_exceptions.IDummy: Does not declaratively implement the interface.r!   assertEqualstrr   dnis     r   test___str__"DoesNotImplementTests.test___str__&   s'    mmoH>	
r   c                 \    U R                  S5      nU R                  [        U5      S5        g )N	candidatezThe object 'candidate' has failed to implement interface zope.interface.tests.test_exceptions.IDummy: Does not declaratively implement the interface.r$   r'   s     r   test___str__w_candidate-DoesNotImplementTests.test___str__w_candidate/   s*    mmK(H>	
r   r   N	r	   r
   r   r   r   r!   r)   r-   r   r   r   r   r   r      s     4

r   r   c                   ,    \ rS rSrS rS rS rS rSrg)BrokenImplementationTests9   c                     SSK Jn  U$ )Nr   )BrokenImplementation)r   r4   )r   r4   s     r   r   )BrokenImplementationTests._getTargetClass;   s    B##r   c                 F    [        5       nU R                  5       " US/UQ76 $ )Nmissingr   r   s      r   r!   "BrokenImplementationTests._makeOne?   s$    ##%eY>>>r   c                 Z    U R                  5       nU R                  [        U5      S5        g )NzAn object has failed to implement interface zope.interface.tests.test_exceptions.IDummy: The 'missing' attribute was not provided.r$   r'   s     r   r)   &BrokenImplementationTests.test___str__C   s'    mmoH8	9r   c                 \    U R                  S5      nU R                  [        U5      S5        g )Nr,   zThe object 'candidate' has failed to implement interface zope.interface.tests.test_exceptions.IDummy: The 'missing' attribute was not provided.r$   r'   s     r   r-   1BrokenImplementationTests.test___str__w_candidateK   s*    mmK(H8	9r   r   Nr/   r   r   r   r1   r1   9   s    $?99r   r1   c                      g)z
This is a global function with a simple argument list.

It exists to be able to report the same information when
formatting signatures.
Nr   r   r   r   broken_functionr>   T   s    r   c                   B    \ rS rSrS rSrS rS rS rS r	S r
S	 rS
rg)BrokenMethodImplementationTests]   c                     SSK Jn  U$ )Nr   BrokenMethodImplementation)r   rD   )r   rD   s     r   r   /BrokenMethodImplementationTests._getTargetClass_   s    H))r   	I said soc                 F    U R                  5       " SU R                  /UQ76 $ )NaMethod)r   message)r   r   s     r   r!   (BrokenMethodImplementationTests._makeOnee   s!    ##%iEEEr   c                 Z    U R                  5       nU R                  [        U5      S5        g )NzoAn object has failed to implement interface <Unknown>: The contract of 'aMethod' is violated because I said so.r$   r'   s     r   r)   ,BrokenMethodImplementationTests.test___str__h   s(    mmoHG	
r   c                 `    U R                  SSS5      nU R                  [        U5      S5        g )Nsome_function<IFoo>r,   zyThe object 'candidate' has failed to implement interface <IFoo>: The contract of 'aMethod' is violated because I said so.r$   r'   s     r   )test___str__w_candidate_no_implementationIBrokenMethodImplementationTests.test___str__w_candidate_no_implementationp   s/    mmOX{CHG	
r   c                 v    SU l         U R                  [        SS5      nU R                  [	        U5      S5        g )Nzimplementation is wonkyrO   r,   zThe object 'candidate' has failed to implement interface <IFoo>: The contract of 'aMethod' is violated because 'broken_function()' is wonky.)rI   r!   r>   r%   r&   r'   s     r   (test___str__w_candidate_w_implementationHBrokenMethodImplementationTests.test___str__w_candidate_w_implementationx   s5    0mmOX{CH,	
r   c                 n    SU l         U R                  SSS5      nU R                  [        U5      S5        g )Nzimplementation is not callable*   rO   r,   zThe object 'candidate' has failed to implement interface <IFoo>: The contract of 'aMethod' is violated because '42' is not callable.)rI   r!   r%   r&   r'   s     r   5test___str__w_candidate_w_implementation_not_callableUBrokenMethodImplementationTests.test___str__w_candidate_w_implementation_not_callable   s5    7mmB+6H$	
r   c                 ^    U R                  S S5      nU R                  [        U5      S5        g )Nr,   zEBrokenMethodImplementation('aMethod', 'I said so', None, 'candidate'))r!   r%   reprr'   s     r   test___repr__w_candidate8BrokenMethodImplementationTests.test___repr__w_candidate   s,    mmD+.I9	
r   )rI   N)r	   r
   r   r   r   rI   r!   r)   rP   rS   rW   r[   r   r   r   r   r@   r@   ]   s-    * GF




r   r@   c                   ,    \ rS rSrS rS rS rS rSrg)MultipleInvalidTests   c                     SSK Jn  U$ )Nr   )MultipleInvalid)r   ra   )r   ra   s     r   r   $MultipleInvalidTests._getTargetClass   s    =r   c                 F    [        5       nU R                  5       " USU5      $ )Ntargetr   )r   excsr    s      r   r!   MultipleInvalidTests._makeOne   s!    ##%eXt<<r   c                     SSK Jn  U" SS5      [        S5      /nU R                  U5      nU R	                  [        U5      S5        g )Nr   rC   rH   rF   zRegular exceptionzThe object 'target' has failed to implement interface zope.interface.tests.test_exceptions.IDummy:
    The contract of 'aMethod' is violated because I said so
    Regular exception)r   rD   	Exceptionr!   r%   r&   r   rD   re   r(   s       r   test__str__ MultipleInvalidTests.test__str__   sI    H&y+>)*
 mmD!H$	
r   c                     SSK Jn  U" SS5      [        SS5      /nU R                  U5      nU R	                  [        U5      S5        g )Nr   rC   rH   rF   Regular	exceptionzMultipleInvalid(<InterfaceClass zope.interface.tests.test_exceptions.IDummy>, 'target', (BrokenMethodImplementation('aMethod', 'I said so'), Exception('Regular', 'exception'))))r   rD   rh   r!   r%   rZ   ri   s       r   test__repr__!MultipleInvalidTests.test__repr__   sL    H&y+> i-	
 mmD!I3	
r   r   N)	r	   r
   r   r   r   r!   rj   ro   r   r   r   r   r^   r^      s    =

r   r^   )	__doc__unittestr   TestCaser   r1   r>   r@   r^   r   r   r   <module>rt      s`    
H-- 
:9 1 1 965
h&7&7 5
p)
8,, )
r   