Current File : //lib/python3/dist-packages/twisted/names/test/__pycache__/test_server.cpython-312.pyc |
�
Ϫ�fȢ � �P � d Z ddlmZ ddlmZ ddlmZ ddlmZm Z m
Z
mZ ddlm
Z
mZ ddlmZ G d� d e� Zd
� Z G d� dej( � Z G d
� dej( � Z G d� d� Z G d� d� Z G d� d� Z G d� d� Zd� Z G d� dej8 � Zy)z)
Test cases for L{twisted.names.server}.
� )�verifyClass)�defer)�IProtocolFactory)�dns�error�resolve�server)�failure�log)�unittestc � � e Zd ZdZd� Zy)�RaisedArgumentszD
An exception containing the arguments raised by L{raiser}.
c � � || _ || _ y �N��args�kwargs��selfr r s �@/usr/lib/python3/dist-packages/twisted/names/test/test_server.py�__init__zRaisedArguments.__init__ s � ��� ���� N)�__name__�
__module__�__qualname__�__doc__r � r r r r s � ��r r c � � t | |� �)z�
Raise a L{RaisedArguments} exception containing the supplied arguments.
Used as a fake when testing the call signatures of methods and functions.
)r r s r �raiserr s � � �$��
'�'r c � � e Zd ZdZd� Zd� Zy)�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 � � y)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�addresss r �
allowQueryz%NoResponseDNSServerFactory.allowQuery. s � � r c � � y)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% s r � sendReplyz$NoResponseDNSServerFactory.sendReply; � � r N)r r r r r&