Known subclasses: twisted.names.test.test_dns.EDNSMessageStandardEncodingTests, twisted.names.test.test_dns.MessageStandardEncodingTests

Tests for the encoding and decoding of various standard (not EDNS) messages.

These tests should work with both dns._EDNSMessage and dns.Message.

TestCase classes that use this mixin must provide a messageFactory method which accepts any argment supported by dns._EDNSMessage.__init__.

EDNS specific arguments may be discarded if not supported by the message class under construction.

Method test_emptyMessageEncode An empty message can be encoded.
Method test_emptyMessageDecode An empty message byte sequence can be decoded.
Method test_completeQueryEncode A fully populated query message can be encoded.
Method test_completeQueryDecode A fully populated message byte string can be decoded.
Method test_NULL A NULL record with an arbitrary payload can be encoded and decoded as part of a message.
Method test_nonAuthoritativeMessageEncode If the message authoritative attribute is set to 0, the encoded bytes will have AA bit 0.
Method test_nonAuthoritativeMessageDecode The dns.RRHeader instances created by a message from a non-authoritative message byte string are marked as not authoritative.
Method test_authoritativeMessageEncode If the message authoritative attribute is set to 1, the encoded bytes will have AA bit 1.
Method test_authoritativeMessageDecode The message and its dns.RRHeader instances created by decode from an authoritative message byte string, are marked as authoritative.
Method test_truncatedMessageEncode If the message trunc attribute is set to 1 the encoded bytes will have TR bit 1.
Method test_truncatedMessageDecode The message instance created by decoding a truncated message is marked as truncated.
def test_emptyMessageEncode(self):

An empty message can be encoded.

def test_emptyMessageDecode(self):

An empty message byte sequence can be decoded.

def test_completeQueryEncode(self):

A fully populated query message can be encoded.

def test_completeQueryDecode(self):

A fully populated message byte string can be decoded.

def test_NULL(self):

A NULL record with an arbitrary payload can be encoded and decoded as part of a message.

def test_nonAuthoritativeMessageEncode(self):

If the message authoritative attribute is set to 0, the encoded bytes will have AA bit 0.

def test_nonAuthoritativeMessageDecode(self):

The dns.RRHeader instances created by a message from a non-authoritative message byte string are marked as not authoritative.

def test_authoritativeMessageEncode(self):

If the message authoritative attribute is set to 1, the encoded bytes will have AA bit 1.

def test_authoritativeMessageDecode(self):

The message and its dns.RRHeader instances created by decode from an authoritative message byte string, are marked as authoritative.

def test_truncatedMessageEncode(self):

If the message trunc attribute is set to 1 the encoded bytes will have TR bit 1.

def test_truncatedMessageDecode(self):

The message instance created by decoding a truncated message is marked as truncated.

API Documentation for twisted, generated by pydoctor at 2020-03-25 17:34:30.