Skip to content
This repository was archived by the owner on Feb 26, 2026. It is now read-only.

Commit 5491715

Browse files
committed
brought in changes from #66
1 parent 6b2cc10 commit 5491715

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

noxfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def system(session):
130130
session.install('mock', 'pytest')
131131
systest_deps = [
132132
'google-cloud-bigquery',
133-
'google-cloud-pubsub',
133+
'google-cloud-pubsub < 2.0.0',
134134
'google-cloud-storage',
135135
'google-cloud-testutils',
136136
]

tests/unit/test__http.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,19 @@ def test_default_url(self):
4949
self.assertIs(conn._client, client)
5050

5151
def test_build_api_url_w_custom_endpoint(self):
52+
from six.moves.urllib.parse import parse_qsl
53+
from six.moves.urllib.parse import urlsplit
54+
5255
custom_endpoint = "https://foo-logging.googleapis.com"
5356
conn = self._make_one(object(), api_endpoint=custom_endpoint)
54-
URI = "/".join([custom_endpoint, conn.API_VERSION, "foo"])
55-
# strip out url arguments for comparison
56-
created_url = conn.build_api_url("/foo").split("?")[0]
57-
self.assertEqual(created_url, URI)
57+
uri = conn.build_api_url("/foo")
58+
scheme, netloc, path, qs, _ = urlsplit(uri)
59+
self.assertEqual("%s://%s" % (scheme, netloc), custom_endpoint)
60+
self.assertEqual(path, "/".join(["", conn.API_VERSION, "foo"]))
61+
parms = dict(parse_qsl(qs))
62+
pretty_print = parms.pop("prettyPrint", "false")
63+
self.assertEqual(pretty_print, "false")
64+
self.assertEqual(parms, {})
5865

5966
def test_extra_headers(self):
6067
import requests

0 commit comments

Comments
 (0)