summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBob Halley <halley@dnspython.org>2020-08-17 06:27:07 -0700
committerBob Halley <halley@dnspython.org>2020-08-17 06:27:07 -0700
commite5545ade37d15ebf87fac626e602ac1ad9852be2 (patch)
treed3a0cd660080d003cbcb28b7b4378f0577fbc64f /tests
parent1359d2465f2749fa1b525ff39f2098fd7aef0c5e (diff)
downloaddnspython-e5545ade37d15ebf87fac626e602ac1ad9852be2.tar.gz
Update _clone protocol for immutable rdatasets.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_rdataset.py9
1 files changed, 9 insertions, 0 deletions
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()