@@ -205,6 +205,11 @@ class Test__urlsafe_b64encode(unittest.TestCase):
205
205
206
206
DEADBEEF_ENCODED = b'ZGVhZGJlZWY'
207
207
208
+ def test_valid_input_str (self ):
209
+ test_string = 'deadbeef'
210
+ result = _helpers ._urlsafe_b64encode (test_string )
211
+ self .assertEqual (result , self .DEADBEEF_ENCODED )
212
+
208
213
def test_valid_input_bytes (self ):
209
214
test_string = b'deadbeef'
210
215
result = _helpers ._urlsafe_b64encode (test_string )
@@ -218,15 +223,22 @@ def test_valid_input_unicode(self):
218
223
219
224
class Test__urlsafe_b64decode (unittest .TestCase ):
220
225
226
+ DEADBEEF_DECODED = b'deadbeef'
227
+
228
+ def test_valid_input_str (self ):
229
+ test_string = 'ZGVhZGJlZWY'
230
+ result = _helpers ._urlsafe_b64decode (test_string )
231
+ self .assertEqual (result , self .DEADBEEF_DECODED )
232
+
221
233
def test_valid_input_bytes (self ):
222
234
test_string = b'ZGVhZGJlZWY'
223
235
result = _helpers ._urlsafe_b64decode (test_string )
224
- self .assertEqual (result , b'deadbeef' )
236
+ self .assertEqual (result , self . DEADBEEF_DECODED )
225
237
226
238
def test_valid_input_unicode (self ):
227
- test_string = b 'ZGVhZGJlZWY'
239
+ test_string = u 'ZGVhZGJlZWY'
228
240
result = _helpers ._urlsafe_b64decode (test_string )
229
- self .assertEqual (result , b'deadbeef' )
241
+ self .assertEqual (result , self . DEADBEEF_DECODED )
230
242
231
243
def test_bad_input (self ):
232
244
import binascii
0 commit comments