aboutsummaryrefslogtreecommitdiff
path: root/tests/test__helpers.py
diff options
context:
space:
mode:
authorPat Ferate <pferate@users.noreply.github.com>2016-08-15 10:16:15 -0700
committerJon Wayne Parrott <jonwayne@google.com>2016-08-15 10:16:15 -0700
commit687fdbdb86fc2dacf904890debc02a7aeb97514a (patch)
treed20a50c4e36df0ee9d28fa6a61f9a8374c06c702 /tests/test__helpers.py
parent499375cea4c9c3e462ad09b3fa36554c92f85d91 (diff)
downloadoauth2client-687fdbdb86fc2dacf904890debc02a7aeb97514a.tar.gz
Update helper b64 encode/decode tests (#631)
Diffstat (limited to 'tests/test__helpers.py')
-rw-r--r--tests/test__helpers.py18
1 files changed, 15 insertions, 3 deletions
diff --git a/tests/test__helpers.py b/tests/test__helpers.py
index c4387e2..8a6aad1 100644
--- a/tests/test__helpers.py
+++ b/tests/test__helpers.py
@@ -205,6 +205,11 @@ class Test__urlsafe_b64encode(unittest.TestCase):
DEADBEEF_ENCODED = b'ZGVhZGJlZWY'
+ def test_valid_input_str(self):
+ test_string = 'deadbeef'
+ result = _helpers._urlsafe_b64encode(test_string)
+ self.assertEqual(result, self.DEADBEEF_ENCODED)
+
def test_valid_input_bytes(self):
test_string = b'deadbeef'
result = _helpers._urlsafe_b64encode(test_string)
@@ -218,15 +223,22 @@ class Test__urlsafe_b64encode(unittest.TestCase):
class Test__urlsafe_b64decode(unittest.TestCase):
+ DEADBEEF_DECODED = b'deadbeef'
+
+ def test_valid_input_str(self):
+ test_string = 'ZGVhZGJlZWY'
+ result = _helpers._urlsafe_b64decode(test_string)
+ self.assertEqual(result, self.DEADBEEF_DECODED)
+
def test_valid_input_bytes(self):
test_string = b'ZGVhZGJlZWY'
result = _helpers._urlsafe_b64decode(test_string)
- self.assertEqual(result, b'deadbeef')
+ self.assertEqual(result, self.DEADBEEF_DECODED)
def test_valid_input_unicode(self):
- test_string = b'ZGVhZGJlZWY'
+ test_string = u'ZGVhZGJlZWY'
result = _helpers._urlsafe_b64decode(test_string)
- self.assertEqual(result, b'deadbeef')
+ self.assertEqual(result, self.DEADBEEF_DECODED)
def test_bad_input(self):
import binascii