diff options
| author | Bob Halley <halley@dnspython.org> | 2020-07-30 09:21:03 -0700 |
|---|---|---|
| committer | Bob Halley <halley@dnspython.org> | 2020-08-10 06:43:32 -0700 |
| commit | 54deb97c2a5331fe99a12d720f24fb481ec31576 (patch) | |
| tree | 0954caa36095efcc667aee6a3732759d4c9001c6 /tests/test_rdataset.py | |
| parent | 26fd19690c44a01c84c27a2d4244d2e5dc7b7a19 (diff) | |
| download | dnspython-transaction.tar.gz | |
txn checkpointtransaction
Diffstat (limited to 'tests/test_rdataset.py')
| -rw-r--r-- | tests/test_rdataset.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/test_rdataset.py b/tests/test_rdataset.py index a80d650..88b4840 100644 --- a/tests/test_rdataset.py +++ b/tests/test_rdataset.py @@ -122,5 +122,34 @@ class RdatasetTestCase(unittest.TestCase): '<DNS IN RRSIG(NSEC) rdataset:')) +class ImmutableRdatasetTestCase(unittest.TestCase): + + def test_basic(self): + rds = dns.rdataset.from_text('in', 'a', 300, '10.0.0.1', '10.0.0.2') + rd = dns.rdata.from_text('in', 'a', '10.0.0.3') + irds = dns.rdataset.ImmutableRdataset(rds) + with self.assertRaises(TypeError): + irds.update_ttl(100) + with self.assertRaises(TypeError): + irds.add(rd, 300) + with self.assertRaises(TypeError): + irds.union_update(rds) + with self.assertRaises(TypeError): + irds.intersection_update(rds) + with self.assertRaises(TypeError): + irds.update(rds) + with self.assertRaises(TypeError): + irds += rds + with self.assertRaises(TypeError): + irds -= rds + with self.assertRaises(TypeError): + irds &= rds + with self.assertRaises(TypeError): + irds |= rds + with self.assertRaises(TypeError): + del irds[0] + with self.assertRaises(TypeError): + irds.clear() + if __name__ == '__main__': unittest.main() |
