+
    <	�i/  ã                   ó‚   € R t ]t^ RIt^ RIHtHtHtHtH	t	H
t
HtHtHt  ! R R]4      t ! R R]P                   4      tR# )z(Tests for the error_for helper function.N)	ÚClientErrorÚConflictÚMethodNotAllowedÚNotFoundÚPreconditionFailedÚResponseErrorÚServerErrorÚUnauthorizedÚ	error_forc                   ó*   a € ] tR t^%t o RtR tRtV tR# )ÚStubRequestz-Just enough of a request to fool error_for().c                ó   € Wn         R # )N©Ústatus©Úselfr   s   &&ÚE/usr/lib/python3/dist-packages/lazr/restfulclient/tests/test_error.pyÚ__init__ÚStubRequest.__init__(   s   € ØŽó    r   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   Ú__static_attributes__Ú__classdictcell__©Ú__classdict__s   @r   r   r   %   s   ø‡ € Ù7÷ð r   r   c                   óf   a € ] tR t^,t o RR ltR tR tR tR tR t	R t
R tR	 tR
 tR tRtV tR# )ÚTestErrorForc                óÊ   € \        V4      p\        WC4      pVf   V P                  V4       R# V P                  \	        WR4      4       V P                  W5P                  4       R# )z9Make sure error_for returns the right HTTPError subclass.N)r   r
   ÚassertIsNoneÚ
assertTrueÚ
isinstanceÚassertEqualÚcontent)r   r   Úexpected_errorr&   ÚrequestÚerrors   &&&&  r   Úerror_for_statusÚTestErrorFor.error_for_status-   sM   € ä˜fÓ%ˆÜ˜'Ó+ˆØÒ!Ø×Ñ˜eÖ$à�O‰OœJ uÓ=Ô>Ø×Ñ˜W§m¡mÖ4r   c                ó<   € R F  pV P                  VR4       K  	  R# )z.Make sure a 2xx response code yields no error.N)éÈ   éÉ   éÑ   i+  ©r*   r   s   & r   Útest_no_error_for_2xxÚ"TestErrorFor.test_no_error_for_2xx7   s   € ã*ˆFØ×!Ñ! &¨$Ö/ó +r   c                ó<   € R F  pV P                  VR4       K  	  R# )z.Make sure a 3xx response code yields no error.N)i-  i.  i/  i0  i�  r0   r   s   & r   Útest_no_error_for_3xxÚ"TestErrorFor.test_no_error_for_3xx<   s   € ã/ˆFØ×!Ñ! &¨$Ö/ó 0r   c                ó4   € V P                  R\        R4       R# )z3Make sure a 400 response code yields ResponseError.i�  úerror messageN)r*   r   ©r   s   &r   Útest_error_for_400ÚTestErrorFor.test_error_for_400A   s   € à×Ñ˜c¤=°/ÖBr   c                ó4   € V P                  R\        R4       R# )z2Make sure a 401 response code yields Unauthorized.i‘  r7   N)r*   r	   r8   s   &r   Útest_error_for_401ÚTestErrorFor.test_error_for_401E   s   € à×Ñ˜c¤<°ÖAr   c                ó4   € V P                  R\        R4       R# )z/Make sure a 404 response code yields Not Found.i”  r7   N)r*   r   r8   s   &r   Útest_error_for_404ÚTestErrorFor.test_error_for_404I   ó   € à×Ñ˜c¤8¨_Ö=r   c                ó4   € V P                  R\        R4       R# )z6Make sure a 405 response code yields MethodNotAllowed.i•  r7   N)r*   r   r8   s   &r   Útest_error_for_405ÚTestErrorFor.test_error_for_405M   s   € à×Ñ˜cÔ#3°_ÖEr   c                ó4   € V P                  R\        R4       R# )z.Make sure a 409 response code yields Conflict.i™  r7   N)r*   r   r8   s   &r   Útest_error_for_409ÚTestErrorFor.test_error_for_409Q   rA   r   c                ó4   € V P                  R\        R4       R# )z8Make sure a 412 response code yields PreconditionFailed.iœ  r7   N)r*   r   r8   s   &r   Útest_error_for_412ÚTestErrorFor.test_error_for_412U   s   € à×Ñ˜cÔ#5°ÖGr   c                ó4   € V P                  R\        R4       R# )z?Make sure an unrexognized 4xx response code yields ClientError.ió  r7   N)r*   r   r8   s   &r   Útest_error_for_4xxÚTestErrorFor.test_error_for_4xxY   s   € à×Ñ˜c¤;°Ö@r   c                óD   € R F  pV P                  V\        4       K  	  R# )z2Make sure a 5xx response codes yields ServerError.N)iô  iö  i÷  iW  )r*   r   r   s   & r   Útest_no_error_for_5xxÚ"TestErrorFor.test_no_error_for_5xx]   s   € ã*ˆFØ×!Ñ! &¬+Ö6ó +r   © N)Ú )r   r   r   r   r*   r1   r4   r9   r<   r?   rC   rF   rI   rL   rO   r   r   r   s   @r   r    r    ,   sF   ø‡ € ô5ò0ò
0ò
CòBò>òFò>òHòA÷7ð 7r   r    )r   ÚtypeÚ__metaclass__ÚunittestÚlazr.restfulclient.errorsr   r   r   r   r   r   r   r	   r
   Úobjectr   ÚTestCaser    rQ   r   r   Ú<module>rY      s?   ðñ$ /à€ã ÷
÷ 
õ 
ô�&ô ô47�8×$Ñ$ö 47r   