Skip to content

Commit

Permalink
Python version differences.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Ide committed Jan 10, 2018
1 parent 0388b28 commit 55d91fd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions aws_google_auth/tests/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ def test_default_if_none(self):
def test_unicode_to_string_if_needed_python_3(self):
if sys.version_info >= (3, 0):
value_string = "Test String!"
self.assertIsInstance(value_string, str)
self.assertIn("str", str(value_string.__class__))
self.assertEqual(util.Util.unicode_to_string_if_needed(value_string), value_string)

def test_unicode_to_string_if_needed_python_2(self):
if sys.version_info < (3, 0):
value_string = "Test String!"
value_unicode = value_string.decode('utf-8')
self.assertIsInstance(value_string, str)
self.assertIsInstance(value_unicode, unicode)
self.assertIn("str", str(value_string.__class__))
self.assertIn("unicode", str(value_unicode.__class__))
self.assertEqual(util.Util.unicode_to_string_if_needed(value_unicode), value_string)
self.assertEqual(util.Util.unicode_to_string_if_needed(value_string), value_string)

0 comments on commit 55d91fd

Please sign in to comment.