Skip to content

Commit 81cff0a

Browse files
committed
Add tests for mixed base64 alphabets
1 parent b79dce6 commit 81cff0a

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

Lib/test/test_email/test__encoded_words.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ def test_urlsafe_alphabet(self):
4343
b'QW5tZWxkdW5nIE5ldHphbnNjaGx1c3MgU_xkcmluZzNwLmpwZw==',
4444
b'Anmeldung Netzanschluss S\xfcdring3p.jpg',
4545
[errors.InvalidBase64CharactersDefect])
46+
# Mix of 2 base64 alphabets
47+
self._test(b'aGVsbG8_Pz8/', b'hello????', [errors.InvalidBase64CharactersDefect])
48+
4649

4750
def test_invalid_character(self):
4851
self._test(b'dm\x01k===', b'vi', [errors.InvalidBase64CharactersDefect])

Lib/test/test_email/test_email.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4666,6 +4666,8 @@ def test_decode(self):
46664666
eq(base64mime.decode(
46674667
'QW5tZWxkdW5nIE5ldHphbnNjaGx1c3MgU_xkcmluZzNwLmpwZw=='),
46684668
b'Anmeldung Netzanschluss S\xfcdring3p.jpg')
4669+
# Mix of 2 base64 alphabets
4670+
eq(base64mime.decode('aGVsbG8_Pz8/'), b'hello????')
46694671

46704672
def test_encode(self):
46714673
eq = self.assertEqual

0 commit comments

Comments
 (0)