Skip to content

Commit fb463ce

Browse files
committed
Drop redundant method overrides, left over from Pub/Sub.
Addresses: #1560 (comment) #1560 (comment)
1 parent 29a973c commit fb463ce

File tree

2 files changed

+0
-79
lines changed

2 files changed

+0
-79
lines changed

gcloud/logging/connection.py

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -46,40 +46,3 @@ class Connection(base_connection.JSONConnection):
4646
'https://www.googleapis.com/auth/logging.admin',
4747
'https://www.googleapis.com/auth/cloud-platform')
4848
"""The scopes required for authenticating as a Cloud Logging consumer."""
49-
50-
def __init__(self, credentials=None, http=None, api_base_url=None):
51-
super(Connection, self).__init__(credentials=credentials, http=http)
52-
if api_base_url is None:
53-
api_base_url = self.__class__.API_BASE_URL
54-
self.api_base_url = api_base_url
55-
56-
def build_api_url(self, path, query_params=None,
57-
api_base_url=None, api_version=None):
58-
"""Construct an API url given a few components, some optional.
59-
60-
Typically, you shouldn't need to use this method.
61-
62-
:type path: string
63-
:param path: The path to the resource.
64-
65-
:type query_params: dict
66-
:param query_params: A dictionary of keys and values to insert into
67-
the query string of the URL.
68-
69-
:type api_base_url: string
70-
:param api_base_url: The base URL for the API endpoint.
71-
Typically you won't have to provide this.
72-
73-
:type api_version: string
74-
:param api_version: The version of the API to call.
75-
Typically you shouldn't provide this and instead
76-
use the default for the library.
77-
78-
:rtype: string
79-
:returns: The URL assembled from the pieces provided.
80-
"""
81-
if api_base_url is None:
82-
api_base_url = self.api_base_url
83-
return super(Connection, self.__class__).build_api_url(
84-
path, query_params=query_params,
85-
api_base_url=api_base_url, api_version=api_version)

gcloud/logging/test_connection.py

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -27,45 +27,3 @@ def _makeOne(self, *args, **kw):
2727
def test_default_url(self):
2828
conn = self._makeOne()
2929
klass = self._getTargetClass()
30-
self.assertEqual(conn.api_base_url, klass.API_BASE_URL)
31-
32-
def test_custom_url_from_constructor(self):
33-
HOST = object()
34-
conn = self._makeOne(api_base_url=HOST)
35-
36-
klass = self._getTargetClass()
37-
self.assertNotEqual(conn.api_base_url, klass.API_BASE_URL)
38-
self.assertEqual(conn.api_base_url, HOST)
39-
40-
def test_build_api_url_no_extra_query_params(self):
41-
conn = self._makeOne()
42-
URI = '/'.join([
43-
conn.API_BASE_URL,
44-
conn.API_VERSION,
45-
'foo',
46-
])
47-
self.assertEqual(conn.build_api_url('/foo'), URI)
48-
49-
def test_build_api_url_w_extra_query_params(self):
50-
from six.moves.urllib.parse import parse_qsl
51-
from six.moves.urllib.parse import urlsplit
52-
conn = self._makeOne()
53-
uri = conn.build_api_url('/foo', {'bar': 'baz'})
54-
scheme, netloc, path, qs, _ = urlsplit(uri)
55-
self.assertEqual('%s://%s' % (scheme, netloc), conn.API_BASE_URL)
56-
self.assertEqual(path,
57-
'/'.join(['', conn.API_VERSION, 'foo']))
58-
parms = dict(parse_qsl(qs))
59-
self.assertEqual(parms['bar'], 'baz')
60-
61-
def test_build_api_url_w_base_url_override(self):
62-
base_url1 = 'api-base-url1'
63-
base_url2 = 'api-base-url2'
64-
conn = self._makeOne(api_base_url=base_url1)
65-
URI = '/'.join([
66-
base_url2,
67-
conn.API_VERSION,
68-
'foo',
69-
])
70-
self.assertEqual(
71-
conn.build_api_url('/foo', api_base_url=base_url2), URI)

0 commit comments

Comments
 (0)