# HG changeset patch # Parent eaa38b75cc7812dbf079801657f6eae9ebb85157 Fixed http.client.__all__ and added a test diff -r eaa38b75cc78 Lib/http/client.py --- a/Lib/http/client.py Fri Jan 23 17:30:26 2015 -0500 +++ b/Lib/http/client.py Tue Feb 10 22:31:56 2015 +0000 @@ -75,12 +75,12 @@ import collections from urllib.parse import urlsplit -__all__ = ["HTTPResponse", "HTTPConnection", +__all__ = ["HTTPResponse", "HTTPConnection", "HTTPMessage", "HTTPException", "NotConnected", "UnknownProtocol", "UnknownTransferEncoding", "UnimplementedFileMode", "IncompleteRead", "InvalidURL", "ImproperConnectionState", "CannotSendRequest", "CannotSendHeader", "ResponseNotReady", - "BadStatusLine", "error", "responses"] + "BadStatusLine", "error", "responses", "parse_headers"] HTTP_PORT = 80 HTTPS_PORT = 443 diff -r eaa38b75cc78 Lib/test/test_httplib.py --- a/Lib/test/test_httplib.py Fri Jan 23 17:30:26 2015 -0500 +++ b/Lib/test/test_httplib.py Tue Feb 10 22:31:56 2015 +0000 @@ -192,6 +192,17 @@ class BasicTest(TestCase): + def test_all(self): + # Documented objects defined in the module should be in __all__ + expected = ["responses"] # White-list documented dict() object + for name in dir(client): + if name == "LineTooLong": # Undocumented object + continue + object = getattr(client, name) + if getattr(object, "__module__", None) == "http.client": + expected.append(name) + self.assertCountEqual(client.__all__, expected) + def test_status_lines(self): # Test HTTP status lines