diff options
| author | Bob Halley <halley@dnspython.org> | 2020-08-18 06:28:21 -0700 |
|---|---|---|
| committer | Bob Halley <halley@dnspython.org> | 2020-08-18 06:28:21 -0700 |
| commit | 279dbec2722bd9836b1adf76db5136aeb346421e (patch) | |
| tree | 8ad06ec695b9e1034e2bc289bde1460fbec836c0 /tests | |
| parent | 352b15dd775370cd731dbab60b65cd50acf395b7 (diff) | |
| download | dnspython-279dbec2722bd9836b1adf76db5136aeb346421e.tar.gz | |
node replace_rdataset() should not permit rrsets
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_zone.py | 9 |
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() |
