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/twisted/test/__pycache__/ |
Upload File : |
o �b � @ sx d Z ddlZddlZddlmZ ddlmZ ddlmZ ddl m Z mZ ddlm Z G dd � d e�ZG d d� de �ZdS )z Test strerror � N)�skipIf)�ECONNABORTED)�platform)�_ErrorFormatter�formatError)�TestCasec @ s e Zd ZdZdS )�_MyWindowsExceptionzT An exception type like L{ctypes.WinError}, but available on all platforms. N)�__name__� __module__�__qualname__�__doc__� r r �</usr/lib/python3/dist-packages/twisted/test/test_strerror.pyr s r c @ st e Zd ZdZeZdZdd� Zdd� Zdd� Z d d � Z dd� Zee �� d kd�dd� �Zee �� d kd�dd� �ZdS )�ErrorFormatingTestsz3 Tests for C{_ErrorFormatter.formatError}. zcorrect message valuec C s0 t ddd�}|�| j�}| �|t�| j�� dS )z� L{_ErrorFormatter.formatError} should use L{os.strerror} to format error messages if it is constructed without any better mechanism. N)r r �probeErrorCode�assertEqual�os�strerror��self� formatter�messager r r �test_strerrorFormatting s z+ErrorFormatingTests.test_strerrorFormattingc C sF d}| � | j|� tdd|di�}|�| j�}| �|t�| j�� dS )z� L{_ErrorFormatter.formatError} should use L{os.strerror} to format error messages if it is constructed with only an error tab which does not contain the error code it is called with. � N� wrong message)�assertNotEqualr r r r r r )r �errorr r r r r �test_emptyErrorTab) s z&ErrorFormatingTests.test_emptyErrorTabc C s2 t dd| j| ji�}|�| j�}| �|| j� dS )z� L{_ErrorFormatter.formatError} should use C{errorTab} if it is supplied and contains the requested error code. N)r r �probeMessager r r r r r � test_errorTab6 s �z!ErrorFormatingTests.test_errorTabc sR g � � �fdd�}t d|�jdi�}|��j�}��|�j� ��� �jg� dS )z~ L{_ErrorFormatter.formatError} should return the return value of C{formatMessage} if it is supplied. c s � � | � �jS �N)�appendr �� errorCode��formatCallsr r r � formatMessageH s z=ErrorFormatingTests.test_formatMessage.<locals>.formatMessageNr �r r r r r )r r&