Add tests for #382

The examples are not arbitrary: base64 by default ignores characters
that are not in its alphabet. When decoding, the dashes and underscores
are not b64-valid and therefore ignored, resulting in a sequence with
the wrong padding.
This commit is contained in:
Rafa de la Torre
2017-10-06 14:37:26 +02:00
parent f79ac9297d
commit 7b988e3f78

View File

@@ -124,3 +124,13 @@ class GoogleGeocoderTestCase(unittest.TestCase):
GoogleMapsGeocoder('another_dummy_client_id',
'lalala',
None)
def test_credentials_with_dashes_can_be_valid(self, req_mock):
GoogleMapsGeocoder('yet_another_dummy_client_id',
'Ola-k-ase---',
None)
def test_credentials_with_underscores_can_be_valid(self, req_mock):
GoogleMapsGeocoder('yet_another_dummy_client_id',
'Ola_k_ase___',
None)