How to use the googlemaps.client.urlencode_params function in googlemaps

To help you get started, we’ve selected a few googlemaps examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github googlemaps / google-maps-services-python / test / test_client.py View on Github external
def test_urlencode(self):
        # See GH #72.
        encoded_params = _client.urlencode_params([("address", "=Sydney ~")])
        self.assertEqual("address=%3DSydney+~", encoded_params)
github googlemaps / google-maps-services-python / test / test_client.py View on Github external
def test_urlencode(self):
        # See GH #72.
        encoded_params = _client.urlencode_params([("address", "=Sydney ~")])
        self.assertEqual("address=%3DSydney+~", encoded_params)
github hzlmn / aiogmaps / tests / test_client.py View on Github external
async def test_url_signed(aresponses, enterprise_client, credentials):
    address = 'Test St.'
    params = {
        'address': address,
        'client': credentials['client_id']
    }

    path = '?'.join(['/maps/api/geocode/json',
                     urlencode_params(params.items())])
    expected_signature = sign_hmac(credentials['client_secret'], path)

    aresponses.add(
        'maps.googleapis.com',
        path + '&signature={}'.format(expected_signature),
        'get',
        aresponses.Response(
            body='{"status": "OK", "results": ["foo"]}',
            status=web.HTTPOk.status_code,
            content_type='application/json',
        ),
        match_querystring=True,
    )
    resp = await enterprise_client.geocode(address)
    assert resp == ['foo']