module documentation

Tests for twisted.names.dns.

Class CommonConstructorTestsMixin Tests for constructor arguments and their associated attributes that are common to both twisted.names.dns._EDNSMessage and dns.Message.
Class CompactReprTests Tests for dns._compactRepr.
Class ConstructorTestsMixin Helper methods for verifying default attribute values and corresponding constructor arguments.
Class DatagramProtocolTests Test various aspects of dns.DNSDatagramProtocol.
Class DNSProtocolTests Test various aspects of dns.DNSProtocol.
Class DomainStringTests No class docstring; 5/5 methods documented
Class EDNSMessageConstructorTests Tests for twisted.names.dns._EDNSMessage constructor arguments that are shared with dns.Message.
Class EDNSMessageEDNSEncodingTests Tests for the encoding and decoding of various EDNS messages.
Class EDNSMessageEqualityTests Tests for equality between dns._EDNSMessage instances.
Class EDNSMessageSpecificsTests Tests for dns._EDNSMessage.
Class EDNSMessageStandardEncodingTests Tests for the encoding and decoding of various standard (non-EDNS) messages by dns._EDNSMessage.
Class EqualityTests Tests for the equality and non-equality behavior of record classes.
Class Foo An example class for use in dns._compactRepr tests. It follows the pattern of initialiser settable flags, fields and sections found in dns.Message and dns._EDNSMessage.
Class IsSubdomainOfTests Tests for twisted.names.dns._isSubdomainOf.
Class MessageAuthoritative A minimal authoritative message.
Class MessageComparable A wrapper around dns.Message which is comparable so that it can be tested using some of the dns._EDNSMessage tests.
Class MessageComparisonTests Tests for the rich comparison of dns.Message instances.
Class MessageComplete An example of a fully populated non-edns response message.
Class MessageConstructorTests Tests for twisted.names.dns.Message constructor arguments that are shared with dns._EDNSMessage.
Class MessageEDNSComplete An example of a fully populated edns response message.
Class MessageEDNSExtendedRCODE An example of an EDNS message with an extended RCODE.
Class MessageEDNSQuery A minimal EDNS query message.
Class MessageEmpty Generate byte string and constructor arguments for an empty dns._EDNSMessage.
Class MessageNonAuthoritative A minimal non-authoritative message.
Class MessageStandardEncodingTests Tests for the encoding and decoding of various standard (non-EDNS) messages by dns.Message.
Class MessageTests Tests for twisted.names.dns.Message.
Class MessageTruncated An empty response message whose TR bit is set to 1.
Class NameTests Tests for Name, the representation of a single domain name with support for encoding into and decoding from DNS message format.
Class NameToLabelsTests Tests for twisted.names.dns._nameToLabels.
Class OPTHeaderTests Tests for twisted.names.dns._OPTHeader.
Class OPTNonStandardAttributes Generate byte and instance representations of an dns._OPTHeader where all attributes are set to non-default values.
Class OPTVariableOptionTests Tests for dns._OPTVariableOption.
Class Ord2ByteTests Tests for dns._ord2bytes.
Class ReprTests Tests for the __repr__ implementation of record classes.
Class ResponseFromMessageTests Tests for dns._responseFromMessage.
Class RoundtripDNSTests Encoding and then decoding various objects.
Class RRHeaderTests Tests for twisted.names.dns.RRHeader.
Class StandardEncodingTestsMixin Tests for the encoding and decoding of various standard (not EDNS) messages.
Class Str2TimeTests Tests for dns.str2name.
Class TestController Pretend to be a DNS query processor for a DNSDatagramProtocol.
Class TestTCPController Pretend to be a DNS query processor for a DNSProtocol.
Exception RaisedArgs An exception which can be raised by fakes to test that the fake is called with expected arguments.
Function assertIsNotSubdomainOf Assert that descendant *is not* a subdomain of ancestor.
Function assertIsSubdomainOf Assert that descendant *is* a subdomain of ancestor.
Function verifyConstructorArgument Verify that an attribute has the expected default value and that a corresponding argument passed to a constructor is assigned to that attribute.
Constant MESSAGE_AUTHENTIC_DATA_BYTES Undocumented
Constant MESSAGE_CHECKING_DISABLED_BYTES Undocumented
Constant RECORD_TYPES Undocumented
def assertIsNotSubdomainOf(testCase, descendant, ancestor): (source)

Assert that descendant *is not* a subdomain of ancestor.

Parameters
testCase:unittest.SynchronousTestCaseThe test case on which to run the assertions.
descendant:strThe subdomain name to test.
ancestor:strThe superdomain name to test.
def assertIsSubdomainOf(testCase, descendant, ancestor): (source)

Assert that descendant *is* a subdomain of ancestor.

Parameters
testCase:unittest.SynchronousTestCaseThe test case on which to run the assertions.
descendant:strThe subdomain name to test.
ancestor:strThe superdomain name to test.
def verifyConstructorArgument(testCase, cls, argName, defaultVal, altVal, attrName=None): (source)

Verify that an attribute has the expected default value and that a corresponding argument passed to a constructor is assigned to that attribute.

Parameters
testCase:unittest.TestCaseThe TestCase whose assert methods will be called.
cls:typeThe constructor under test.
argName:strThe name of the constructor argument under test.
defaultVal:objectThe expected default value of attrName / argName
altVal:objectA value which is different from the default. Used to test that supplied constructor arguments are actually assigned to the correct attribute.
attrName:strThe name of the attribute under test if different from argName. Defaults to argName
MESSAGE_AUTHENTIC_DATA_BYTES: bytes = (source)

Undocumented

Value
b'\x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x00'
MESSAGE_CHECKING_DISABLED_BYTES: bytes = (source)

Undocumented

Value
b'\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00'