]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
test versioned zone non-txn get of nonexistent set
authorBob Halley <halley@dnspython.org>
Sat, 12 Mar 2022 22:40:27 +0000 (14:40 -0800)
committerBob Halley <halley@dnspython.org>
Sat, 12 Mar 2022 22:40:27 +0000 (14:40 -0800)
tests/test_zone.py

index 7f3bf13c0db340647ffa629dac698d3e80f0d492..b7046b2d7d16aa743133ed89d32544e4f6244d29 100644 (file)
@@ -1096,6 +1096,19 @@ class VersionedZoneTestCase(unittest.TestCase):
         with self.assertRaises(dns.zone.NoSOA):
             soa = z.get_soa()
 
+    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()