MCPcopy Create free account
hub / github.com/rthalley/dnspython / test_module_registration

Method test_module_registration

tests/test_rdata.py:58–67  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

56 self.assertEqual(rdata.address, "1.2.3.4")
57
58 def test_module_registration(self):
59 TTXT = 64001
60 dns.rdata.register_type(tests.ttxt_module, TTXT, "TTXT")
61 rdata = dns.rdata.from_text(dns.rdataclass.IN, TTXT, "hello world")
62 self.assertEqual(rdata.strings, (b"hello", b"world"))
63 self.assertEqual(dns.rdatatype.to_text(TTXT), "TTXT")
64 self.assertEqual(dns.rdatatype.from_text("TTXT"), TTXT)
65 self.assertEqual(dns.rdatatype.RdataType.make("TTXT"), TTXT)
66 self.assertEqual(dns.rdatatype.from_text("ttxt"), TTXT)
67 self.assertEqual(dns.rdatatype.RdataType.make("ttxt"), TTXT)
68
69 def test_class_registration(self):
70 CTXT = 64003

Callers

nothing calls this directly

Calls 3

from_textMethod · 0.45
to_textMethod · 0.45
makeMethod · 0.45

Tested by

no test coverage detected