Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions googlemaps/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,11 @@ def __init__(self, key=None, client_id=None, client_secret=None,
raise ValueError("Invalid API key provided.")

if channel:
if not client_id:
raise ValueError("The channel argument must be used with a "
"client ID")
if not re.match("^[a-zA-Z0-9._-]*$", channel):
raise ValueError("The channel argument must be an ASCII "
"alphanumeric string. The period (.), underscore (_)"
"and hyphen (-) characters are allowed.")
"and hyphen (-) characters are allowed. If used without "
"client_id, it must be 0-999.")

self.session = requests.Session()
self.key = key
Expand Down
4 changes: 0 additions & 4 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,6 @@ def __call__(self, req):

self.assertEqual(2, len(responses.calls))

def test_channel_without_client_id(self):
with self.assertRaises(ValueError):
client = googlemaps.Client(key="AIzaasdf", channel="mychannel")

def test_invalid_channel(self):
# Cf. limitations here:
# https://developers.google.com/maps/premium/reports
Expand Down