class StandardEncodingTestsMixin: (source)
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_authoritative |
The message and its dns.RRHeader instances created by decode from an authoritative message byte string, are marked as authoritative. |
Method | test_authoritative |
If the message authoritative attribute is set to 1, the encoded bytes will have AA bit 1. |
Method | test_complete |
A fully populated message byte string can be decoded. |
Method | test_complete |
A fully populated query message can be encoded. |
Method | test_empty |
An empty message byte sequence can be decoded. |
Method | test_empty |
An empty message can be encoded. |
Method | test_non |
The dns.RRHeader instances created by a message from a non-authoritative message byte string are marked as not authoritative. |
Method | test_non |
If the message authoritative attribute is set to 0, the encoded bytes will have AA bit 0. |
Method | test_ |
A NULL record with an arbitrary payload can be encoded and decoded as part of a message. |
Method | test_truncated |
The message instance created by decoding a truncated message is marked as truncated. |
Method | test_truncated |
If the message trunc attribute is set to 1 the encoded bytes will have TR bit 1. |
The message and its dns.RRHeader
instances created by decode from an authoritative message byte string, are marked as authoritative.
The dns.RRHeader
instances created by a message from a non-authoritative message byte string are marked as not authoritative.