summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBob Halley <halley@dnspython.org>2020-08-18 06:28:21 -0700
committerBob Halley <halley@dnspython.org>2020-08-18 06:28:21 -0700
commit279dbec2722bd9836b1adf76db5136aeb346421e (patch)
tree8ad06ec695b9e1034e2bc289bde1460fbec836c0 /tests
parent352b15dd775370cd731dbab60b65cd50acf395b7 (diff)
downloaddnspython-279dbec2722bd9836b1adf76db5136aeb346421e.tar.gz
node replace_rdataset() should not permit rrsets
Diffstat (limited to 'tests')
-rw-r--r--tests/test_zone.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_zone.py b/tests/test_zone.py
index a301cb2..78fbb28 100644
--- a/tests/test_zone.py
+++ b/tests/test_zone.py
@@ -792,5 +792,14 @@ class ZoneTestCase(unittest.TestCase):
z2 = dns.zone.from_text(out, 'example.', relativize=True)
self.assertEqual(z, z2)
+ def testNodeReplaceRdatasetConvertsRRsets(self):
+ node = dns.node.Node()
+ rrs = dns.rrset.from_text('foo', 300, 'in', 'a', '10.0.0.1')
+ node.replace_rdataset(rrs)
+ rds = node.find_rdataset(dns.rdataclass.IN, dns.rdatatype.A)
+ self.assertEqual(rds, rrs)
+ self.assertTrue(rds is not rrs)
+ self.assertFalse(isinstance(rds, dns.rrset.RRset))
+
if __name__ == '__main__':
unittest.main()