-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from Globegitter/to-global-id-unicode-error
Fix utf-8 error on py 2.7
- Loading branch information
Showing
10 changed files
with
97 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
import base64 | ||
|
||
from .. import utils | ||
|
||
|
||
def test_base64_encode_unicode_strings_correctly(): | ||
my_unicode = u'ûñö' | ||
my_base64 = utils.base64(my_unicode) | ||
assert my_base64 == base64.b64encode(my_unicode.encode('utf-8')).decode('utf-8') | ||
|
||
my_unicode = u'\u06ED' | ||
my_base64 = utils.base64(my_unicode) | ||
assert my_base64 == base64.b64encode(my_unicode.encode('utf-8')).decode('utf-8') | ||
|
||
|
||
def test_base64_encode_strings_correctly(): | ||
my_string = 'abc' | ||
my_base64 = utils.base64(my_string) | ||
assert my_base64 == base64.b64encode(my_string.encode('utf-8')).decode('utf-8') | ||
|
||
|
||
def test_unbase64_decodes_unicode_strings_correctly(): | ||
my_unicode = u'ûñö' | ||
my_converted_unicode = utils.unbase64(utils.base64(my_unicode)) | ||
assert my_unicode == my_converted_unicode | ||
|
||
|
||
def test_unbase64_decodes_strings_correctly(): | ||
my_string = 'abc' | ||
my_converted_string = utils.unbase64(utils.base64(my_string)) | ||
assert my_string == my_converted_string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters