403Webshell
Server IP : 167.99.254.82  /  Your IP : 216.73.216.188
Web Server : Apache
System : Linux host.techisquad.com 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64
User : pawluxera ( 1011)
PHP Version : 8.1.34
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3/dist-packages/lazr/restfulclient/tests/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/lazr/restfulclient/tests/__pycache__/test_error.cpython-310.pyc
o

��%U
�@sbdZeZddlZddlmZmZmZmZm	Z	m
Z
mZmZm
Z
Gdd�de�ZGdd�dej�ZdS)z(Tests for the error_for helper function.�N)	�ClientError�Conflict�MethodNotAllowed�NotFound�PreconditionFailed�
ResponseError�ServerError�Unauthorized�	error_forc@seZdZdZdd�ZdS)�DummyRequestz-Just enough of a request to fool error_for().cCs
||_dS)N)�status��selfr�r�E/usr/lib/python3/dist-packages/lazr/restfulclient/tests/test_error.py�__init__s
zDummyRequest.__init__N)�__name__�
__module__�__qualname__�__doc__rrrrrrsrc@sfeZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dS)�TestErrorFor�cCsJt|�}t||�}|dur|�|�dS|�t||��|�||j�dS)z9Make sure error_for returns the right HTTPError subclass.N)rr
�assertIsNone�
assertTrue�
isinstance�assertEqual�content)rr�expected_errorr�request�errorrrr�error_for_status%s
zTestErrorFor.error_for_statuscC�dD]}|�|d�qdS)z.Make sure a 2xx response code yields no error.)������i+N�r r
rrr�test_no_error_for_2xx/��z"TestErrorFor.test_no_error_for_2xxcCr!)z.Make sure a 3xx response code yields no error.)i-i.i/i0i�Nr%r
rrr�test_no_error_for_3xx4r'z"TestErrorFor.test_no_error_for_3xxcC�|�dtd�dS)z3Make sure a 400 response code yields ResponseError.i��
error messageN)r r�rrrr�test_error_for_4009�zTestErrorFor.test_error_for_400cCr))z2Make sure a 401 response code yields Unauthorized.i�r*N)r r	r+rrr�test_error_for_401=r-zTestErrorFor.test_error_for_401cCr))z/Make sure a 404 response code yields Not Found.i�r*N)r rr+rrr�test_error_for_404Ar-zTestErrorFor.test_error_for_404cCr))z6Make sure a 405 response code yields MethodNotAllowed.i�r*N)r rr+rrr�test_error_for_405Er-zTestErrorFor.test_error_for_405cCr))z.Make sure a 409 response code yields Conflict.i�r*N)r rr+rrr�test_error_for_409Ir-zTestErrorFor.test_error_for_409cCr))z8Make sure a 412 response code yields PreconditionFailed.i�r*N)r rr+rrr�test_error_for_412Mr-zTestErrorFor.test_error_for_412cCr))z?Make sure an unrexognized 4xx response code yields ClientError.i�r*N)r rr+rrr�test_error_for_4xxQr-zTestErrorFor.test_error_for_4xxcCsdD]}|�|t�qdS)z2Make sure a 5xx response codes yields ServerError.)i�i�i�iWN)r rr
rrr�test_no_error_for_5xxUr'z"TestErrorFor.test_no_error_for_5xxN)r)rrrr r&r(r,r.r/r0r1r2r3r4rrrrr#s

r)r�type�
__metaclass__�unittest�lazr.restfulclient.errorsrrrrrrrr	r
�objectr�TestCaserrrrr�<module>s,

Youez - 2016 - github.com/yon3zu
LinuXploit