summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBob Halley <halley@play-bow.org>2022-03-12 14:45:40 -0800
committerBob Halley <halley@play-bow.org>2022-03-12 14:45:40 -0800
commitd11b358c065e2af6fa7d517bf8abb12e99321fcb (patch)
treebbeb82451c6a108e24d5513b7c883aecae5bc9d9 /tests
parent8a05f0c96f0d1558c3d65deac9059162c5687a48 (diff)
downloaddnspython-2.2.tar.gz
Do no raise an assertion getting a nonexistent rdataset without a txn in a versioned zone.2.2
Diffstat (limited to 'tests')
-rw-r--r--tests/test_zone.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_zone.py b/tests/test_zone.py
index 45fa272..9059388 100644
--- a/tests/test_zone.py
+++ b/tests/test_zone.py
@@ -1076,6 +1076,18 @@ class VersionedZoneTestCase(unittest.TestCase):
dns.rdatatype.RRSIG,
dns.rdatatype.NSEC))
+ def testGetRdataset1(self):
+ z = dns.zone.from_text(example_text, 'example.', relativize=True,
+ zone_factory=dns.versioned.Zone)
+ rds = z.get_rdataset('@', 'soa')
+ exrds = dns.rdataset.from_text('IN', 'SOA', 300, 'foo bar 1 2 3 4 5')
+ self.assertEqual(rds, exrds)
+
+ def testGetRdataset2(self):
+ z = dns.zone.from_text(example_text, 'example.', relativize=True,
+ zone_factory=dns.versioned.Zone)
+ rds = z.get_rdataset('@', 'loc')
+ self.assertTrue(rds is None)
if __name__ == '__main__':
unittest.main()