class documentation

class DNSServerFactoryTests(unittest.TestCase): (source)

View In Hierarchy

Method test_allowQueryFalse If allowQuery returns False, server.DNSServerFactory.messageReceived calls server.sendReply with a message whose rCode is dns.EREFUSED.
Method test_authorities server.DNSServerFactory.__init__ accepts an authorities argument. The value of this argument is a list and is used to extend the resolver resolve.ResolverChain.
Method test_buildProtocolProtocolOverride server.DNSServerFactory.buildProtocol builds a protocol by calling server.DNSServerFactory.protocol with its self as a positional argument.
Method test_cacheDefault server.DNSServerFactory.cache is None by default.
Method test_cacheOverride server.DNSServerFactory.__init__ assigns the last object in the caches list to server.DNSServerFactory.cache.
Method test_caches server.DNSServerFactory.__init__ accepts a caches argument. The value of this argument is a list and is used to extend the resolver resolve.ResolverChain.
Method test_canRecurseDefault server.DNSServerFactory.canRecurse is a flag indicating that this server is capable of performing recursive DNS lookups. It defaults to False.
Method test_canRecurseOverride server.DNSServerFactory.__init__ sets canRecurse to True if it is supplied with clients.
Method test_clients server.DNSServerFactory.__init__ accepts a clients argument. The value of this argument is a list and is used to extend the resolver resolve.ResolverChain.
Method test_connectionTracking The connectionMade and connectionLost methods of DNSServerFactory cooperate to keep track of all DNSProtocol objects created by a factory which are connected.
Method test_defaultProtocol server.DNSServerFactory.protocol defaults to dns.DNSProtocol.
Method test_gotResolverErrorAuthoritativeDomainError server.DNSServerFactory.gotResolver triggers a response message with an rCode of dns.ENAME if supplied with a error.AuthoritativeDomainError.
Method test_gotResolverErrorCallsResponseFromMessage server.DNSServerFactory.gotResolverError calls server.DNSServerFactory._responseFromMessage to generate a response.
Method test_gotResolverErrorDomainError server.DNSServerFactory.gotResolver triggers a response message with an rCode of dns.ENAME if supplied with a error.DomainError.
Method test_gotResolverErrorLogging server.DNSServerFactory.gotResolver logs a message if verbose > 0.
Method test_gotResolverErrorOtherError server.DNSServerFactory.gotResolver triggers a response message with an rCode of dns.ESERVER if supplied with another type of error and logs the error.
Method test_gotResolverErrorResetsResponseAttributes server.DNSServerFactory.gotResolverError does not allow request attributes to leak into the response ie it sends a response with AD, CD set to 0 and empty response record sections.
Method test_gotResolverResponse server.DNSServerFactory.gotResolverResponse accepts a tuple of resource record lists and triggers a response message containing those resource record lists.
Method test_gotResolverResponseCaching server.DNSServerFactory.gotResolverResponse caches the response if at least one cache was provided in the constructor.
Method test_gotResolverResponseCallsResponseFromMessage server.DNSServerFactory.gotResolverResponse calls server.DNSServerFactory._responseFromMessage to generate a response.
Method test_gotResolverResponseLogging server.DNSServerFactory.gotResolverResponse logs the total number of records in the response if verbose > 0.
Method test_gotResolverResponseResetsResponseAttributes server.DNSServerFactory.gotResolverResponse does not allow request attributes to leak into the response ie it sends a response with AD, CD set to 0 and none of the records in the request answer sections are copied to the response.
Method test_handleInverseQuery server.DNSServerFactory.handleInverseQuery triggers the sending of a response message with rCode set to dns.ENOTIMP.
Method test_handleInverseQueryLogging server.DNSServerFactory.handleInverseQuery logs the message origin address if verbose > 0.
Method test_handleNotify server.DNSServerFactory.handleNotify triggers the sending of a response message with rCode set to dns.ENOTIMP.
Method test_handleNotifyLogging server.DNSServerFactory.handleNotify logs the message origin address if verbose > 0.
Method test_handleOther server.DNSServerFactory.handleOther triggers the sending of a response message with rCode set to dns.ENOTIMP.
Method test_handleOtherLogging server.DNSServerFactory.handleOther logs the message origin address if verbose > 0.
Method test_handleQuery server.DNSServerFactory.handleQuery takes the first query from the supplied message and dispatches it to server.DNSServerFactory.resolver.query.
Method test_handleQueryCallback server.DNSServerFactory.handleQuery adds server.DNSServerFactory.resolver.gotResolverResponse as a callback to the deferred returned by server.DNSServerFactory.resolver.query. It is called with the query response, the original protocol, message and origin address.
Method test_handleQueryErrback server.DNSServerFactory.handleQuery adds server.DNSServerFactory.resolver.gotResolverError as an errback to the deferred returned by server.DNSServerFactory.resolver.query. It is called with the query failure, the original protocol, message and origin address.
Method test_handleStatus server.DNSServerFactory.handleStatus triggers the sending of a response message with rCode set to dns.ENOTIMP.
Method test_handleStatusLogging server.DNSServerFactory.handleStatus logs the message origin address if verbose > 0.
Method test_interface server.DNSServerFactory implements IProtocolFactory.
Method test_inverseQueryMessageReceived DNSServerFactory.messageReceived passes messages with an opcode of OP_INVERSE on to DNSServerFactory.handleInverseQuery.
Method test_messageFactory server.DNSServerFactory has a _messageFactory attribute which is dns.Message by default.
Method test_messageReceivedAllowQuery server.DNSServerFactory.messageReceived passes all messages to server.DNSServerFactory.allowQuery along with the receiving protocol and origin address.
Method test_messageReceivedLogging1 server.DNSServerFactory.messageReceived logs the query types of all queries in the message if verbose is set to 1.
Method test_messageReceivedLogging2 server.DNSServerFactory.messageReceived logs the repr of all queries in the message if verbose is set to 2.
Method test_messageReceivedLoggingNoQuery server.DNSServerFactory.messageReceived logs about an empty query if the message had no queries and verbose is >0.
Method test_messageReceivedTimestamp server.DNSServerFactory.messageReceived assigns a unix timestamp to the received message.
Method test_notifyMessageReceived DNSServerFactory.messageReceived passes messages with an opcode of OP_NOTIFY on to DNSServerFactory.handleNotify.
Method test_queryMessageReceived DNSServerFactory.messageReceived passes messages with an opcode of OP_QUERY on to DNSServerFactory.handleQuery.
Method test_resolverDefaultEmpty server.DNSServerFactory.resolver is an empty resolve.ResolverChain by default.
Method test_resolverOrder server.DNSServerFactory.resolver contains an ordered list of authorities, caches and clients.
Method test_resolverType server.DNSServerFactory.resolver is a resolve.ResolverChain instance
Method test_responseFromMessageAuthoritativeMessage server.DNSServerFactory._responseFromMessage marks the response message as authoritative if any of the answer records are authoritative.
Method test_responseFromMessageCallsMessageFactory server.DNSServerFactory._responseFromMessage calls dns._responseFromMessage to generate a response message from the request message. It supplies the request message and other keyword arguments which should be passed to the response message initialiser.
Method test_responseFromMessageMaxSize server.DNSServerFactory._responseFromMessage generates a response message whose maxSize attribute has the same value as that found on the request.
Method test_responseFromMessageNewMessage server.DNSServerFactory._responseFromMessage generates a response message which is a copy of the request message.
Method test_responseFromMessageRecursionAvailable server.DNSServerFactory._responseFromMessage generates a response message whose recAV attribute is True if server.DNSServerFactory.canRecurse is True.
Method test_responseFromMessageTimeReceived server.DNSServerFactory._responseFromMessage generates a response message whose timeReceived attribute has the same value as that found on the request.
Method test_sendReplyLoggingNoAnswers If server.DNSServerFactory.sendReply logs a "no answers" message if the supplied message has no answers.
Method test_sendReplyLoggingWithAnswers If server.DNSServerFactory.sendReply logs a message for answers, authority, additional if the supplied a message has records in any of those sections.
Method test_sendReplyWithAddress If server.DNSServerFactory.sendReply is supplied with a protocol *and* an address tuple it will supply that address to protocol.writeMessage.
Method test_sendReplyWithoutAddress If server.DNSServerFactory.sendReply is supplied with a protocol but no address tuple it will supply only a message to protocol.writeMessage.
Method test_statusMessageReceived DNSServerFactory.messageReceived passes messages with an opcode of OP_STATUS on to DNSServerFactory.handleStatus.
Method test_updateMessageReceived DNSServerFactory.messageReceived passes messages with an opcode of OP_UPDATE on to DNSServerFactory.handleOther.
Method test_verboseDefault server.DNSServerFactory.verbose defaults to False.
Method test_verboseLogQuiet server.DNSServerFactory._verboseLog does not log messages unless verbose > 0.
Method test_verboseLogVerbose server.DNSServerFactory._verboseLog logs a message if verbose > 0.
Method test_verboseOverride server.DNSServerFactory.__init__ accepts a verbose argument which overrides server.DNSServerFactory.verbose.
Method _assertMessageRcodeForError server.DNSServerFactory.gotResolver accepts a failure.Failure and triggers a response message whose rCode corresponds to the DNS error contained in the Failure.
Method _messageReceivedTest Assert that the named method is called with the given message when it is passed to DNSServerFactory.messageReceived.

Inherited from TestCase:

Method __call__ Run the test. Should always do exactly the same thing as run().
Method __init__ Construct an asynchronous test case for methodName.
Method addCleanup Extend the base cleanup feature with support for cleanup functions which return Deferreds.
Method assertFailure Fail if deferred does not errback with one of expectedFailures. Returns the original Deferred with callbacks added. You will need to return this Deferred from your test case.
Method deferRunCleanups Run any scheduled cleanups and report errors (if any) to the result. object.
Method deferSetUp Undocumented
Method deferTearDown Undocumented
Method deferTestMethod Undocumented
Method getSuppress Undocumented
Method getTimeout Returns the timeout value set on this test. Checks on the instance first, then the class, then the module, then packages. As soon as it finds something with a timeout attribute, returns that. Returns util.DEFAULT_TIMEOUT_DURATION...
Instance Variable timeout A real number of seconds. If set, the test will raise an error if it takes longer than timeout seconds. If not set, util.DEFAULT_TIMEOUT_DURATION is used.
Method _cbDeferTestMethod Undocumented
Method _classCleanUp Undocumented
Method _cleanUp Undocumented
Method _deprecateReactor Deprecate iterate, crash and stop on reactor. That is, each method is wrapped in a function that issues a deprecation warning, then calls the original.
Method _ebDeferSetUp Undocumented
Method _ebDeferTearDown Undocumented
Method _ebDeferTestMethod Undocumented
Method _makeReactorMethod Create a method which wraps the reactor method name. The new method issues a deprecation warning and calls the original.
Method _run Run a single method, either a test method or fixture.
Method _runFixturesAndTest Really run setUp, the test method, and tearDown. Any of these may return defer.Deferreds. After they complete, do some reactor cleanup.
Method _undeprecateReactor Restore the deprecated reactor methods. Undoes what _deprecateReactor did.
Method _wait Take a Deferred that only ever callbacks. Block until it happens.
Instance Variable _passed Undocumented
Instance Variable _reactorMethods Undocumented
Instance Variable _timedOut Undocumented

Inherited from SynchronousTestCase (via TestCase):

Method __eq__ Override the comparison defined by the base TestCase which considers instances of the same class with the same _testMethodName to be equal. Since trial puts TestCase instances into a set, that definition of comparison makes it impossible to run the same test method twice...
Method __hash__ Undocumented
Method callDeprecated Call a function that should have been deprecated at a specific version and in favor of a specific alternative, and assert that it was thusly deprecated.
Method flushLoggedErrors Remove stored errors received from the log.
Method flushWarnings Remove stored warnings from the list of captured warnings and return them.
Method getDeprecatedModuleAttribute Retrieve a module attribute which should have been deprecated, and assert that we saw the appropriate deprecation warning.
Method getSkip Return the skip reason set on this test, if any is set. Checks on the instance first, then the class, then the module, then packages. As soon as it finds something with a skip attribute, returns that in a tuple (...
Method getTodo Return a Todo object if the test is marked todo. Checks on the instance first, then the class, then the module, then packages. As soon as it finds something with a todo attribute, returns that. Returns ...
Method mktemp Create a new path name which can be used for a new file or directory.
Method patch Monkey patch an object for the duration of the test.
Method run Run the test case, storing the results in result.
Method runTest If no methodName argument is passed to the constructor, run will treat this method as the thing with the actual test inside.
Method shortDescription Undocumented
Instance Variable failureException An exception class, defaulting to FailTest. If the test method raises this exception, it will be reported as a failure, rather than an exception. All of the assertion methods raise this if the assertion fails.
Instance Variable skip None or a string explaining why this test is to be skipped. If defined, the test will not be run. Instead, it will be reported to the result object as 'skipped' (if the TestResult supports skipping).
Instance Variable suppress None or a list of tuples of (args, kwargs) to be passed to warnings.filterwarnings. Use these to suppress warnings raised in a test. Useful for testing deprecated code. See also util.suppress.
Instance Variable todo None, a string or a tuple of (errors, reason) where errors is either an exception class or an iterable of exception classes, and reason is a string. See Todo or makeTodo for more information.
Method _getSkipReason Return the reason to use for skipping a test method.
Method _getSuppress Returns any warning suppressions set for this test. Checks on the instance first, then the class, then the module, then packages. As soon as it finds something with a suppress attribute, returns that. ...
Method _installObserver Undocumented
Method _removeObserver Undocumented
Method _runCleanups Synchronously run any cleanups which have been added.
Instance Variable _cleanups Undocumented
Instance Variable _observer Undocumented
Instance Variable _parents Undocumented
Instance Variable _testMethodName Undocumented
Instance Variable _warnings Undocumented

Inherited from _Assertions (via TestCase, SynchronousTestCase):

Method assertAlmostEqual Fail if the two objects are unequal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero.
Method assertApproximates Fail if first - second > tolerance
Method assertEqual Fail the test if first and second are not equal.
Method assertFalse Fail the test if condition evaluates to True.
Method assertIn Fail the test if containee is not found in container.
Method assertIs Fail the test if first is not second. This is an obect-identity-equality test, not an object equality (i.e. __eq__) test.
Method assertIsInstance Fail if instance is not an instance of the given class or of one of the given classes.
Method assertIsNot Fail the test if first is second. This is an obect-identity-equality test, not an object equality (i.e. __eq__) test.
Method assertNoResult Assert that deferred does not have a result at this point.
Method assertNotAlmostEqual Fail if the two objects are equal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero.
Method assertNotEqual Fail the test if first == second.
Method assertNotIn Fail the test if containee is found in container.
Method assertNotIsInstance Fail if instance is an instance of the given class or of one of the given classes.
Method assertNotSubstring Fail if astring contains substring.
Method assertRaises Fail the test unless calling the function f with the given args and kwargs raises exception. The failure will report the traceback and call stack of the unexpected exception.
Method assertSubstring Fail if substring does not exist within astring.
Method assertTrue Fail the test if condition evaluates to False.
Method assertWarns Fail if the given function doesn't generate the specified warning when called. It calls the function, checks the warning, and forwards the result of the function if everything is fine.
Method fail Absolutely fail the test. Do not pass go, do not collect $200.
Method failureResultOf Return the current failure result of deferred or raise self.failureException.
Method successResultOf Return the current success result of deferred or raise self.failureException.
def test_allowQueryFalse(self): (source)

If allowQuery returns False, server.DNSServerFactory.messageReceived calls server.sendReply with a message whose rCode is dns.EREFUSED.

def test_authorities(self): (source)

server.DNSServerFactory.__init__ accepts an authorities argument. The value of this argument is a list and is used to extend the resolver resolve.ResolverChain.

def test_buildProtocolProtocolOverride(self): (source)

server.DNSServerFactory.buildProtocol builds a protocol by calling server.DNSServerFactory.protocol with its self as a positional argument.

def test_cacheDefault(self): (source)
def test_cacheOverride(self): (source)

server.DNSServerFactory.__init__ assigns the last object in the caches list to server.DNSServerFactory.cache.

def test_caches(self): (source)

server.DNSServerFactory.__init__ accepts a caches argument. The value of this argument is a list and is used to extend the resolver resolve.ResolverChain.

def test_canRecurseDefault(self): (source)

server.DNSServerFactory.canRecurse is a flag indicating that this server is capable of performing recursive DNS lookups. It defaults to False.

def test_canRecurseOverride(self): (source)

server.DNSServerFactory.__init__ sets canRecurse to True if it is supplied with clients.

def test_clients(self): (source)

server.DNSServerFactory.__init__ accepts a clients argument. The value of this argument is a list and is used to extend the resolver resolve.ResolverChain.

def test_connectionTracking(self): (source)

The connectionMade and connectionLost methods of DNSServerFactory cooperate to keep track of all DNSProtocol objects created by a factory which are connected.

def test_defaultProtocol(self): (source)
def test_gotResolverErrorAuthoritativeDomainError(self): (source)

server.DNSServerFactory.gotResolver triggers a response message with an rCode of dns.ENAME if supplied with a error.AuthoritativeDomainError.

def test_gotResolverErrorCallsResponseFromMessage(self): (source)
def test_gotResolverErrorDomainError(self): (source)

server.DNSServerFactory.gotResolver triggers a response message with an rCode of dns.ENAME if supplied with a error.DomainError.

def test_gotResolverErrorLogging(self): (source)

server.DNSServerFactory.gotResolver logs a message if verbose > 0.

def test_gotResolverErrorOtherError(self): (source)

server.DNSServerFactory.gotResolver triggers a response message with an rCode of dns.ESERVER if supplied with another type of error and logs the error.

def test_gotResolverErrorResetsResponseAttributes(self): (source)

server.DNSServerFactory.gotResolverError does not allow request attributes to leak into the response ie it sends a response with AD, CD set to 0 and empty response record sections.

def test_gotResolverResponse(self): (source)

server.DNSServerFactory.gotResolverResponse accepts a tuple of resource record lists and triggers a response message containing those resource record lists.

def test_gotResolverResponseCaching(self): (source)

server.DNSServerFactory.gotResolverResponse caches the response if at least one cache was provided in the constructor.

def test_gotResolverResponseCallsResponseFromMessage(self): (source)
def test_gotResolverResponseLogging(self): (source)

server.DNSServerFactory.gotResolverResponse logs the total number of records in the response if verbose > 0.

def test_gotResolverResponseResetsResponseAttributes(self): (source)

server.DNSServerFactory.gotResolverResponse does not allow request attributes to leak into the response ie it sends a response with AD, CD set to 0 and none of the records in the request answer sections are copied to the response.

def test_handleInverseQuery(self): (source)

server.DNSServerFactory.handleInverseQuery triggers the sending of a response message with rCode set to dns.ENOTIMP.

def test_handleInverseQueryLogging(self): (source)

server.DNSServerFactory.handleInverseQuery logs the message origin address if verbose > 0.

def test_handleNotify(self): (source)

server.DNSServerFactory.handleNotify triggers the sending of a response message with rCode set to dns.ENOTIMP.

def test_handleNotifyLogging(self): (source)

server.DNSServerFactory.handleNotify logs the message origin address if verbose > 0.

def test_handleOther(self): (source)

server.DNSServerFactory.handleOther triggers the sending of a response message with rCode set to dns.ENOTIMP.

def test_handleOtherLogging(self): (source)

server.DNSServerFactory.handleOther logs the message origin address if verbose > 0.

def test_handleQuery(self): (source)

server.DNSServerFactory.handleQuery takes the first query from the supplied message and dispatches it to server.DNSServerFactory.resolver.query.

def test_handleQueryCallback(self): (source)

server.DNSServerFactory.handleQuery adds server.DNSServerFactory.resolver.gotResolverResponse as a callback to the deferred returned by server.DNSServerFactory.resolver.query. It is called with the query response, the original protocol, message and origin address.

def test_handleQueryErrback(self): (source)

server.DNSServerFactory.handleQuery adds server.DNSServerFactory.resolver.gotResolverError as an errback to the deferred returned by server.DNSServerFactory.resolver.query. It is called with the query failure, the original protocol, message and origin address.

def test_handleStatus(self): (source)

server.DNSServerFactory.handleStatus triggers the sending of a response message with rCode set to dns.ENOTIMP.

def test_handleStatusLogging(self): (source)

server.DNSServerFactory.handleStatus logs the message origin address if verbose > 0.

def test_interface(self): (source)
def test_inverseQueryMessageReceived(self): (source)

DNSServerFactory.messageReceived passes messages with an opcode of OP_INVERSE on to DNSServerFactory.handleInverseQuery.

def test_messageFactory(self): (source)

server.DNSServerFactory has a _messageFactory attribute which is dns.Message by default.

def test_messageReceivedAllowQuery(self): (source)

server.DNSServerFactory.messageReceived passes all messages to server.DNSServerFactory.allowQuery along with the receiving protocol and origin address.

def test_messageReceivedLogging1(self): (source)

server.DNSServerFactory.messageReceived logs the query types of all queries in the message if verbose is set to 1.

def test_messageReceivedLogging2(self): (source)

server.DNSServerFactory.messageReceived logs the repr of all queries in the message if verbose is set to 2.

def test_messageReceivedLoggingNoQuery(self): (source)

server.DNSServerFactory.messageReceived logs about an empty query if the message had no queries and verbose is >0.

def test_messageReceivedTimestamp(self): (source)

server.DNSServerFactory.messageReceived assigns a unix timestamp to the received message.

def test_notifyMessageReceived(self): (source)

DNSServerFactory.messageReceived passes messages with an opcode of OP_NOTIFY on to DNSServerFactory.handleNotify.

def test_queryMessageReceived(self): (source)

DNSServerFactory.messageReceived passes messages with an opcode of OP_QUERY on to DNSServerFactory.handleQuery.

def test_resolverDefaultEmpty(self): (source)
def test_resolverOrder(self): (source)

server.DNSServerFactory.resolver contains an ordered list of authorities, caches and clients.

def test_responseFromMessageAuthoritativeMessage(self): (source)

server.DNSServerFactory._responseFromMessage marks the response message as authoritative if any of the answer records are authoritative.

def test_responseFromMessageCallsMessageFactory(self): (source)

server.DNSServerFactory._responseFromMessage calls dns._responseFromMessage to generate a response message from the request message. It supplies the request message and other keyword arguments which should be passed to the response message initialiser.

def test_responseFromMessageMaxSize(self): (source)

server.DNSServerFactory._responseFromMessage generates a response message whose maxSize attribute has the same value as that found on the request.

def test_responseFromMessageNewMessage(self): (source)

server.DNSServerFactory._responseFromMessage generates a response message which is a copy of the request message.

def test_responseFromMessageRecursionAvailable(self): (source)

server.DNSServerFactory._responseFromMessage generates a response message whose recAV attribute is True if server.DNSServerFactory.canRecurse is True.

def test_responseFromMessageTimeReceived(self): (source)

server.DNSServerFactory._responseFromMessage generates a response message whose timeReceived attribute has the same value as that found on the request.

def test_sendReplyLoggingNoAnswers(self): (source)

If server.DNSServerFactory.sendReply logs a "no answers" message if the supplied message has no answers.

def test_sendReplyLoggingWithAnswers(self): (source)

If server.DNSServerFactory.sendReply logs a message for answers, authority, additional if the supplied a message has records in any of those sections.

def test_sendReplyWithAddress(self): (source)

If server.DNSServerFactory.sendReply is supplied with a protocol *and* an address tuple it will supply that address to protocol.writeMessage.

def test_sendReplyWithoutAddress(self): (source)

If server.DNSServerFactory.sendReply is supplied with a protocol but no address tuple it will supply only a message to protocol.writeMessage.

def test_statusMessageReceived(self): (source)

DNSServerFactory.messageReceived passes messages with an opcode of OP_STATUS on to DNSServerFactory.handleStatus.

def test_updateMessageReceived(self): (source)

DNSServerFactory.messageReceived passes messages with an opcode of OP_UPDATE on to DNSServerFactory.handleOther.

This may change if the implementation ever covers update messages.

def test_verboseDefault(self): (source)
def test_verboseLogQuiet(self): (source)

server.DNSServerFactory._verboseLog does not log messages unless verbose > 0.

def test_verboseLogVerbose(self): (source)

server.DNSServerFactory._verboseLog logs a message if verbose > 0.

def test_verboseOverride(self): (source)

server.DNSServerFactory.__init__ accepts a verbose argument which overrides server.DNSServerFactory.verbose.

def _assertMessageRcodeForError(self, responseError, expectedMessageCode): (source)

server.DNSServerFactory.gotResolver accepts a failure.Failure and triggers a response message whose rCode corresponds to the DNS error contained in the Failure.

Parameters
responseError:ExceptionThe Exception instance which is expected to trigger expectedMessageCode when it is supplied to gotResolverError
expectedMessageCode:intThe rCode which is expected in the message returned by gotResolverError in response to responseError.
def _messageReceivedTest(self, methodName, message): (source)

Assert that the named method is called with the given message when it is passed to DNSServerFactory.messageReceived.

Parameters
methodName:strThe name of the method which is expected to be called.
message:dns.MessageThe message which is expected to be passed to the methodName method.