From 5b1e2a42a8880575a48b1fe2868fb4bc5f987f4e Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Mon, 27 Feb 2012 00:18:45 -0500 Subject: - The method ``pyramid.request.Request.partial_application_url`` is no longer in the API docs. It was meant to be a private method; its publication in the documentation as an API method was a mistake, and it has been renamed to something private. --- CHANGES.txt | 11 +++++++++++ pyramid/tests/test_url.py | 34 +++++++++++++++++----------------- pyramid/url.py | 6 +++--- 3 files changed, 31 insertions(+), 20 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 207dbad05..2c3d2c3a8 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,14 @@ +Next release +============ + +Bug Fixes +--------- + +- The method ``pyramid.request.Request.partial_application_url`` is no longer + in the API docs. It was meant to be a private method; its publication in + the documentation as an API method was a mistake, and it has been renamed + to something private. + 1.3b1 (2012-02-26) ================== diff --git a/pyramid/tests/test_url.py b/pyramid/tests/test_url.py index 527bf31bc..7f002cbd6 100644 --- a/pyramid/tests/test_url.py +++ b/pyramid/tests/test_url.py @@ -625,7 +625,7 @@ class TestURLMethodsMixin(unittest.TestCase): 'HTTP_HOST':'example.com:80', } request = self._makeOne(environ) - result = request.partial_application_url() + result = request._partial_application_url() self.assertEqual(result, 'http://example.com') def test_partial_application_url_with_http_host_default_port_https(self): @@ -634,7 +634,7 @@ class TestURLMethodsMixin(unittest.TestCase): 'HTTP_HOST':'example.com:443', } request = self._makeOne(environ) - result = request.partial_application_url() + result = request._partial_application_url() self.assertEqual(result, 'https://example.com') def test_partial_application_url_with_http_host_nondefault_port_http(self): @@ -643,7 +643,7 @@ class TestURLMethodsMixin(unittest.TestCase): 'HTTP_HOST':'example.com:8080', } request = self._makeOne(environ) - result = request.partial_application_url() + result = request._partial_application_url() self.assertEqual(result, 'http://example.com:8080') def test_partial_application_url_with_http_host_nondefault_port_https(self): @@ -652,7 +652,7 @@ class TestURLMethodsMixin(unittest.TestCase): 'HTTP_HOST':'example.com:4443', } request = self._makeOne(environ) - result = request.partial_application_url() + result = request._partial_application_url() self.assertEqual(result, 'https://example.com:4443') def test_partial_application_url_with_http_host_no_colon(self): @@ -662,7 +662,7 @@ class TestURLMethodsMixin(unittest.TestCase): 'SERVER_PORT':'80', } request = self._makeOne(environ) - result = request.partial_application_url() + result = request._partial_application_url() self.assertEqual(result, 'http://example.com') def test_partial_application_url_no_http_host(self): @@ -672,7 +672,7 @@ class TestURLMethodsMixin(unittest.TestCase): 'SERVER_PORT':'80', } request = self._makeOne(environ) - result = request.partial_application_url() + result = request._partial_application_url() self.assertEqual(result, 'http://example.com') def test_partial_application_replace_port(self): @@ -682,7 +682,7 @@ class TestURLMethodsMixin(unittest.TestCase): 'SERVER_PORT':'80', } request = self._makeOne(environ) - result = request.partial_application_url(port=8080) + result = request._partial_application_url(port=8080) self.assertEqual(result, 'http://example.com:8080') def test_partial_application_replace_scheme_https_special_case(self): @@ -692,7 +692,7 @@ class TestURLMethodsMixin(unittest.TestCase): 'SERVER_PORT':'80', } request = self._makeOne(environ) - result = request.partial_application_url(scheme='https') + result = request._partial_application_url(scheme='https') self.assertEqual(result, 'https://example.com') def test_partial_application_replace_scheme_https_special_case_avoid(self): @@ -702,7 +702,7 @@ class TestURLMethodsMixin(unittest.TestCase): 'SERVER_PORT':'80', } request = self._makeOne(environ) - result = request.partial_application_url(scheme='https', port='8080') + result = request._partial_application_url(scheme='https', port='8080') self.assertEqual(result, 'https://example.com:8080') def test_partial_application_replace_scheme_http_special_case(self): @@ -712,7 +712,7 @@ class TestURLMethodsMixin(unittest.TestCase): 'SERVER_PORT':'8080', } request = self._makeOne(environ) - result = request.partial_application_url(scheme='http') + result = request._partial_application_url(scheme='http') self.assertEqual(result, 'http://example.com') def test_partial_application_replace_scheme_http_special_case_avoid(self): @@ -722,7 +722,7 @@ class TestURLMethodsMixin(unittest.TestCase): 'SERVER_PORT':'8000', } request = self._makeOne(environ) - result = request.partial_application_url(scheme='http', port='8080') + result = request._partial_application_url(scheme='http', port='8080') self.assertEqual(result, 'http://example.com:8080') def test_partial_application_replace_host_no_port(self): @@ -732,7 +732,7 @@ class TestURLMethodsMixin(unittest.TestCase): 'SERVER_PORT':'80', } request = self._makeOne(environ) - result = request.partial_application_url(host='someotherhost.com') + result = request._partial_application_url(host='someotherhost.com') self.assertEqual(result, 'http://someotherhost.com') def test_partial_application_replace_host_with_port(self): @@ -742,7 +742,7 @@ class TestURLMethodsMixin(unittest.TestCase): 'SERVER_PORT':'8000', } request = self._makeOne(environ) - result = request.partial_application_url(host='someotherhost.com:8080') + result = request._partial_application_url(host='someotherhost.com:8080') self.assertEqual(result, 'http://someotherhost.com:8080') def test_partial_application_replace_host_and_port(self): @@ -752,8 +752,8 @@ class TestURLMethodsMixin(unittest.TestCase): 'SERVER_PORT':'80', } request = self._makeOne(environ) - result = request.partial_application_url(host='someotherhost.com:8080', - port='8000') + result = request._partial_application_url(host='someotherhost.com:8080', + port='8000') self.assertEqual(result, 'http://someotherhost.com:8000') def test_partial_application_replace_host_port_and_scheme(self): @@ -763,7 +763,7 @@ class TestURLMethodsMixin(unittest.TestCase): 'SERVER_PORT':'80', } request = self._makeOne(environ) - result = request.partial_application_url( + result = request._partial_application_url( host='someotherhost.com:8080', port='8000', scheme='https', @@ -778,7 +778,7 @@ class TestURLMethodsMixin(unittest.TestCase): } request = self._makeOne(environ) request.script_name = '/abc' - result = request.partial_application_url() + result = request._partial_application_url() self.assertEqual(result, 'http://example.com:8000/abc') class Test_route_url(unittest.TestCase): diff --git a/pyramid/url.py b/pyramid/url.py index efcf241b7..022867967 100644 --- a/pyramid/url.py +++ b/pyramid/url.py @@ -32,7 +32,7 @@ class URLMethodsMixin(object): """ Request methods mixin for BaseRequest having to do with URL generation """ - def partial_application_url(self, scheme=None, host=None, port=None): + def _partial_application_url(self, scheme=None, host=None, port=None): """ Construct the URL defined by request.application_url, replacing any of the default scheme, host, or port portions with user-supplied @@ -239,7 +239,7 @@ class URLMethodsMixin(object): if app_url is None: if (scheme is not None or host is not None or port is not None): - app_url = self.partial_application_url(scheme, host, port) + app_url = self._partial_application_url(scheme, host, port) else: app_url = self.application_url @@ -468,7 +468,7 @@ class URLMethodsMixin(object): if app_url is None: if scheme or host or port: - app_url = self.partial_application_url(scheme, host, port) + app_url = self._partial_application_url(scheme, host, port) else: app_url = self.application_url -- cgit v1.2.3