summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_email/test_headerregistry.py
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2014-10-17 23:30:13 (GMT)
committerR David Murray <rdmurray@bitdance.com>2014-10-17 23:30:13 (GMT)
commit685b3495e1fd9853b1ca5960db3e3cb705920d4f (patch)
tree890832e8c33e710072208220a20175442b9b29a5 /Lib/test/test_email/test_headerregistry.py
parentd6967320256a65b847cfc64173d12bf818171db5 (diff)
downloadcpython-685b3495e1fd9853b1ca5960db3e3cb705920d4f.zip
cpython-685b3495e1fd9853b1ca5960db3e3cb705920d4f.tar.gz
cpython-685b3495e1fd9853b1ca5960db3e3cb705920d4f.tar.bz2
#21991: make headerregistry params property MappingProxyType.
It is unlikely anyone is using the fact that the dictionary returned by the 'params' attribute was previously writable, but even if someone is the API is provisional so this kind of change is acceptable (and needed, to get the API "right" before it becomes official). Patch by Stéphane Wirtel.
Diffstat (limited to 'Lib/test/test_email/test_headerregistry.py')
-rw-r--r--Lib/test/test_email/test_headerregistry.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_email/test_headerregistry.py b/Lib/test/test_email/test_headerregistry.py
index 7d64a38..55ecdea 100644
--- a/Lib/test/test_email/test_headerregistry.py
+++ b/Lib/test/test_email/test_headerregistry.py
@@ -1,6 +1,7 @@
import datetime
import textwrap
import unittest
+import types
from email import errors
from email import policy
from email.message import Message
@@ -235,6 +236,8 @@ class TestContentTypeHeader(TestHeaderBase):
self.assertEqual(h.maintype, maintype)
self.assertEqual(h.subtype, subtype)
self.assertEqual(h.params, parmdict)
+ with self.assertRaises(TypeError):
+ h.params['abc'] = 'xyz' # params is read-only.
self.assertDefectsEqual(h.defects, defects)
self.assertEqual(h, decoded)
self.assertEqual(h.fold(policy=policy.default), folded)