Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_as_list(self):
self.assertEqual([1], convert.as_list(1))
self.assertEqual([1, 2, 3], convert.as_list([1, 2, 3]))
self.assertEqual(["string"], convert.as_list("string"))
self.assertEqual((1, 2), convert.as_list((1, 2)))
a_dict = {"a": 1}
self.assertEqual([a_dict], convert.as_list(a_dict))
def test_as_list(self):
self.assertEqual([1], convert.as_list(1))
self.assertEqual([1, 2, 3], convert.as_list([1, 2, 3]))
self.assertEqual(["string"], convert.as_list("string"))
self.assertEqual((1, 2), convert.as_list((1, 2)))
a_dict = {"a": 1}
self.assertEqual([a_dict], convert.as_list(a_dict))
def test_as_list(self):
self.assertEqual([1], convert.as_list(1))
self.assertEqual([1, 2, 3], convert.as_list([1, 2, 3]))
self.assertEqual(["string"], convert.as_list("string"))
self.assertEqual((1, 2), convert.as_list((1, 2)))
a_dict = {"a": 1}
self.assertEqual([a_dict], convert.as_list(a_dict))
def test_as_list(self):
self.assertEqual([1], convert.as_list(1))
self.assertEqual([1, 2, 3], convert.as_list([1, 2, 3]))
self.assertEqual(["string"], convert.as_list("string"))
self.assertEqual((1, 2), convert.as_list((1, 2)))
a_dict = {"a": 1}
self.assertEqual([a_dict], convert.as_list(a_dict))
def speed_limits(client, place_ids):
"""Returns the posted speed limit (in km/h) for given road segments.
:param place_ids: The Place ID of the road segment. Place IDs are returned
by the snap_to_roads function. You can pass up to 100 Place IDs.
:type place_ids: str or list
:rtype: list of speed limits.
"""
params = [("placeId", place_id) for place_id in convert.as_list(place_ids)]
return client._request("/v1/speedLimits", params,
base_url=_ROADS_BASE_URL,
accepts_clientid=False,
extract_body=_roads_extract).get("speedLimits", [])