Server IP : 209.38.156.173 / Your IP : 216.73.216.122 [ Web Server : Apache/2.4.52 (Ubuntu) System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64 User : root ( 0) PHP Version : 8.1.2-1ubuntu2.22 Disable Function : NONE Domains : 2 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib/python3/dist-packages/lazr/restfulclient/tests/__pycache__/ |
Upload File : |
o ��%U � @ sb d Z eZddlZddlmZmZmZmZm Z m Z mZmZm Z G dd� de�ZG dd� dej�ZdS )z(Tests for the error_for helper function.� N) �ClientError�Conflict�MethodNotAllowed�NotFound�PreconditionFailed� ResponseError�ServerError�Unauthorized� error_forc @ s e Zd ZdZdd� ZdS )�DummyRequestz-Just enough of a request to fool error_for().c C s || _ d S )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__r r r r r r s r c @ sf e Zd Zddd�Zdd� Zdd� Zdd � Zd d� Zdd � Zdd� Z dd� Z dd� Zdd� Zdd� Z dS )�TestErrorFor� c C sJ t |�}t||�}|du r| �|� dS | �t||�� | �||j� dS )z9Make sure error_for returns the right HTTPError subclass.N)r r �assertIsNone� assertTrue� isinstance�assertEqual�content)r r �expected_errorr �request�errorr r r �error_for_status% s zTestErrorFor.error_for_statusc C � dD ]}| � |d� qdS )z.Make sure a 2xx response code yields no error.)�� �� �� i+ N�r r r r r �test_no_error_for_2xx/ � �z"TestErrorFor.test_no_error_for_2xxc C r! )z.Make sure a 3xx response code yields no error.)i- i. i/ i0 i� Nr% r r r r �test_no_error_for_3xx4 r'