diff options
| author | Brian Wellington <bwelling@xbill.org> | 2020-06-17 15:13:12 -0700 |
|---|---|---|
| committer | Brian Wellington <bwelling@xbill.org> | 2020-06-17 15:13:12 -0700 |
| commit | 2e50d55ede849f0150264864595336eef0cbd52f (patch) | |
| tree | e5461ce6b29b494d358f7bf9a0d6c24f4f3b6027 | |
| parent | ffdd837961fceab98c763fb5fbc63ab157e78e9c (diff) | |
| download | dnspython-2e50d55ede849f0150264864595336eef0cbd52f.tar.gz | |
Test message encoding with EDNS options.
| -rw-r--r-- | tests/test_message.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_message.py b/tests/test_message.py index ab40a05..4e80e01 100644 --- a/tests/test_message.py +++ b/tests/test_message.py @@ -144,6 +144,15 @@ class MessageTestCase(unittest.TestCase): m = dns.message.from_wire(goodwire3) self.assertEqual(str(m), query_text_2) + def test_EDNS_options_wire(self): + m = dns.message.make_query('foo', 'A') + opt = dns.edns.GenericOption(3, b'data') + m.use_edns(options=[opt]) + m2 = dns.message.from_wire(m.to_wire()) + self.assertEqual(m2.edns, 0) + self.assertEqual(len(m2.options), 1) + self.assertEqual(m2.options[0], opt) + def test_TooBig(self): def bad(): q = dns.message.from_text(query_text) |
