From e5545ade37d15ebf87fac626e602ac1ad9852be2 Mon Sep 17 00:00:00 2001 From: Bob Halley Date: Mon, 17 Aug 2020 06:27:07 -0700 Subject: Update _clone protocol for immutable rdatasets. --- tests/test_rdataset.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests') diff --git a/tests/test_rdataset.py b/tests/test_rdataset.py index 88b4840..4710e2a 100644 --- a/tests/test_rdataset.py +++ b/tests/test_rdataset.py @@ -151,5 +151,14 @@ class ImmutableRdatasetTestCase(unittest.TestCase): with self.assertRaises(TypeError): irds.clear() + def test_cloning(self): + rds1 = dns.rdataset.from_text('in', 'a', 300, '10.0.0.1', '10.0.0.2') + rds1 = dns.rdataset.ImmutableRdataset(rds1) + rds2 = dns.rdataset.from_text('in', 'a', 300, '10.0.0.2', '10.0.0.3') + rds2 = dns.rdataset.ImmutableRdataset(rds2) + expected = dns.rdataset.from_text('in', 'a', 300, '10.0.0.2') + intersection = rds1.intersection(rds2) + self.assertEqual(intersection, expected) + if __name__ == '__main__': unittest.main() -- cgit v1.2.1