summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBob Halley <halley@dnspython.org>2020-08-08 07:19:23 -0700
committerBob Halley <halley@dnspython.org>2020-08-08 07:19:23 -0700
commit89d7e549b07646cc1cd1a84b0fb943722e2700fb (patch)
treefd747e845b341608679db9e3c20a36b92ade75c2 /tests
parent71d57aa6d122ef78b743642d04738d3d58cf43e0 (diff)
downloaddnspython-89d7e549b07646cc1cd1a84b0fb943722e2700fb.tar.gz
Make SVCB and HTTPS immutable.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_svcb.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_svcb.py b/tests/test_svcb.py
index a11a13b..9d9bda2 100644
--- a/tests/test_svcb.py
+++ b/tests/test_svcb.py
@@ -272,3 +272,14 @@ class SVCBTestCase(unittest.TestCase):
wire = bytes.fromhex('0000000000000400010003')
with self.assertRaises(dns.exception.FormError):
dns.rdata.from_wire('in', 'svcb', wire, 0, len(wire))
+
+ def test_immutability(self):
+ alpn = dns.rdtypes.svcbbase.ALPNParam.from_value(['h2', 'h3'])
+ with self.assertRaises(TypeError):
+ alpn.ids[0] = 'foo'
+ with self.assertRaises(TypeError):
+ del alpn.ids[0]
+ with self.assertRaises(TypeError):
+ alpn.ids = 'foo'
+ with self.assertRaises(TypeError):
+ del alpn.ids