| 1 |
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license |
| 2 |
|
| 3 |
import unittest |
| 4 |
|
| 5 |
import dns.dnssec |
| 6 |
import dns.edns |
| 7 |
import dns.flags |
| 8 |
import dns.message |
| 9 |
import dns.opcode |
| 10 |
import dns.rcode |
| 11 |
import dns.rdtypes.dnskeybase |
| 12 |
import dns.update |
| 13 |
import tests.util |
| 14 |
|
| 15 |
|
| 16 |
class ConstantsTestCase(unittest.TestCase): |
| 17 |
def test_dnssec_constants(self): |
| 18 |
tests.util.check_enum_exports( |
| 19 |
dns.dnssec, self.assertEqual, only={dns.dnssec.Algorithm} |
| 20 |
) |
| 21 |
tests.util.check_enum_exports(dns.rdtypes.dnskeybase, self.assertEqual) |
| 22 |
|
| 23 |
def test_flags_constants(self): |
| 24 |
tests.util.check_enum_exports(dns.flags, self.assertEqual) |
| 25 |
tests.util.check_enum_exports(dns.rcode, self.assertEqual) |
| 26 |
tests.util.check_enum_exports(dns.opcode, self.assertEqual) |
| 27 |
|
| 28 |
def test_message_constants(self): |
| 29 |
tests.util.check_enum_exports( |
| 30 |
dns.message, self.assertEqual, only={dns.message.MessageSection} |
| 31 |
) |
| 32 |
tests.util.check_enum_exports(dns.update, self.assertEqual) |
| 33 |
|
| 34 |
def test_rdata_constants(self): |
| 35 |
tests.util.check_enum_exports(dns.rdataclass, self.assertEqual) |
| 36 |
tests.util.check_enum_exports(dns.rdatatype, self.assertEqual) |
| 37 |
|
| 38 |
def test_edns_constants(self): |
| 39 |
tests.util.check_enum_exports( |
| 40 |
dns.edns, self.assertEqual, only={dns.edns.OptionType} |
| 41 |
) |