Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/twisted/names/test/__pycache__/test_server.cpython-39.pyc
Ðазад
a k�hǢ � @ s� d Z ddlmZ ddlmZ ddlmZ ddlmZm Z m Z mZ ddlm Z mZ ddlmZ G dd � d e�Zd d� ZG dd � d ej�ZG dd� dej�ZG dd� d�ZG dd� d�ZG dd� d�ZG dd� d�Zdd� ZG dd� dej�ZdS )z) Test cases for L{twisted.names.server}. � )�verifyClass)�defer)�IProtocolFactory)�dns�error�resolve�server)�failure�log)�unittestc @ s e Zd ZdZdd� ZdS )�RaisedArgumentszD An exception containing the arguments raised by L{raiser}. c C s || _ || _d S �N��args�kwargs��selfr r � r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/twisted/names/test/test_server.py�__init__ s zRaisedArguments.__init__N)�__name__� __module__�__qualname__�__doc__r r r r r r s r c O s t | |��dS )z� Raise a L{RaisedArguments} exception containing the supplied arguments. Used as a fake when testing the call signatures of methods and functions. N)r r r r r �raiser s r c @ s e Zd ZdZdd� Zdd� ZdS )�NoResponseDNSServerFactorya A L{server.DNSServerFactory} subclass which does not attempt to reply to any received messages. Used for testing logged messages in C{messageReceived} without having to fake or patch the preceding code which attempts to deliver a response message. c C s dS )a Deny all queries. @param message: See L{server.DNSServerFactory.allowQuery} @param protocol: See L{server.DNSServerFactory.allowQuery} @param address: See L{server.DNSServerFactory.allowQuery} @return: L{False} @rtype: L{bool} Fr )r �message�protocol�addressr r r � allowQuery. s z%NoResponseDNSServerFactory.allowQueryc C s dS )z� A noop send reply. @param protocol: See L{server.DNSServerFactory.sendReply} @param message: See L{server.DNSServerFactory.sendReply} @param address: See L{server.DNSServerFactory.sendReply} Nr )r r r r r r r � sendReply; s z$NoResponseDNSServerFactory.sendReplyN)r r r r r r r r r r r $ s r c @ s( e Zd ZdZG dd� de�Zdd� ZdS )�RaisingDNSServerFactoryz� A L{server.DNSServerFactory} subclass whose methods raise an exception containing the supplied arguments. Used for stopping L{messageReceived} and testing the arguments supplied to L{allowQuery}. c @ s e Zd ZdZdS )z+RaisingDNSServerFactory.AllowQueryArguments�G Contains positional and keyword arguments in C{args}. N�r r r r r r r r �AllowQueryArgumentsN s r$ c O s | � ||��dS )aC Raise the arguments supplied to L{allowQuery}. @param args: Positional arguments which will be recorded in the raised exception. @type args: L{tuple} @param kwargs: Keyword args which will be recorded in the raised exception. @type kwargs: L{dict} N)r$ r r r r r S s z"RaisingDNSServerFactory.allowQueryN)r r r r � Exceptionr$ r r r r r r! E s r! c @ s( e Zd ZdZG dd� de�Zdd� ZdS )�RaisingProtocolzm A partial fake L{IProtocol} whose methods raise an exception containing the supplied arguments. c @ s e Zd ZdZdS )z%RaisingProtocol.WriteMessageArgumentsr"