diff options
author | R David Murray <rdmurray@bitdance.com> | 2012-05-27 19:03:38 (GMT) |
---|---|---|
committer | R David Murray <rdmurray@bitdance.com> | 2012-05-27 19:03:38 (GMT) |
commit | ea9766897bf1d2ccf610ff9ce805acca7c4cce6f (patch) | |
tree | df17698b2efec46c390580be246b4124fce93cd6 /Lib/test/test_email/test_policy.py | |
parent | 393da3240a29852c0e1188c6ccd007e89426a887 (diff) | |
download | cpython-ea9766897bf1d2ccf610ff9ce805acca7c4cce6f.zip cpython-ea9766897bf1d2ccf610ff9ce805acca7c4cce6f.tar.gz cpython-ea9766897bf1d2ccf610ff9ce805acca7c4cce6f.tar.bz2 |
Make headerregistry fully part of the provisional api.
When I made the checkin of the provisional email policy, I knew that
Address and Group needed to be made accessible from somewhere. The more
I looked at it, though, the more it became clear that since this is a
provisional API anyway, there's no good reason to hide headerregistry as
a private API. It was designed to ultimately be part of the public API,
and so it should be part of the provisional API.
This patch fully documents the headerregistry API, and deletes the
abbreviated version of those docs I had added to the provisional policy
docs.
Diffstat (limited to 'Lib/test/test_email/test_policy.py')
-rw-r--r-- | Lib/test/test_email/test_policy.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/test/test_email/test_policy.py b/Lib/test/test_email/test_policy.py index 45a7666..983bd49 100644 --- a/Lib/test/test_email/test_policy.py +++ b/Lib/test/test_email/test_policy.py @@ -5,7 +5,7 @@ import unittest import email.policy import email.parser import email.generator -from email import _headerregistry +from email import headerregistry def make_defaults(base_defaults, differences): defaults = base_defaults.copy() @@ -185,11 +185,11 @@ class PolicyAPITests(unittest.TestCase): def test_default_header_factory(self): h = email.policy.default.header_factory('Test', 'test') self.assertEqual(h.name, 'Test') - self.assertIsInstance(h, _headerregistry.UnstructuredHeader) - self.assertIsInstance(h, _headerregistry.BaseHeader) + self.assertIsInstance(h, headerregistry.UnstructuredHeader) + self.assertIsInstance(h, headerregistry.BaseHeader) class Foo: - parse = _headerregistry.UnstructuredHeader.parse + parse = headerregistry.UnstructuredHeader.parse def test_each_Policy_gets_unique_factory(self): policy1 = email.policy.EmailPolicy() @@ -197,10 +197,10 @@ class PolicyAPITests(unittest.TestCase): policy1.header_factory.map_to_type('foo', self.Foo) h = policy1.header_factory('foo', 'test') self.assertIsInstance(h, self.Foo) - self.assertNotIsInstance(h, _headerregistry.UnstructuredHeader) + self.assertNotIsInstance(h, headerregistry.UnstructuredHeader) h = policy2.header_factory('foo', 'test') self.assertNotIsInstance(h, self.Foo) - self.assertIsInstance(h, _headerregistry.UnstructuredHeader) + self.assertIsInstance(h, headerregistry.UnstructuredHeader) def test_clone_copies_factory(self): policy1 = email.policy.EmailPolicy() |