Example #1
0
 def test_number_should_be_encoded(self):
     result = decode_to_unicode(42)
     self.assertEquals(result, "42")
Example #2
0
 def test_none_should_be_returned_unchanged(self):
     result = decode_to_unicode(None)
     self.assertTrue(result is None)
Example #3
0
 def test_unknown_encoding_should_not_raise_error(self):
     result = decode_to_unicode(b'A m\x9b\x9bse once bit my sister')
     self.assertTrue(isinstance(result, six.text_type))
Example #4
0
 def test_utf_8_encoded_ifalias_should_be_properly_decoded(self):
     result = decode_to_unicode(b'A m\xc3\xb8\xc3\xb8se once bit my sister')
     expected = u'A m\xf8\xf8se once bit my sister'
     self.assertEquals(result, expected)
Example #5
0
 def test_number_should_be_encoded(self):
     result = decode_to_unicode(42)
     self.assertEquals(result, "42")
Example #6
0
 def test_unknown_encoding_should_not_raise_error(self):
     result = decode_to_unicode('A m\x9b\x9bse once bit my sister')
     self.assertTrue(isinstance(result, unicode))
Example #7
0
 def test_none_should_be_returned_unchanged(self):
     result = decode_to_unicode(None)
     self.assertTrue(result is None)
Example #8
0
 def test_utf_8_encoded_ifalias_should_be_properly_decoded(self):
     result = decode_to_unicode('A m\xc3\xb8\xc3\xb8se once bit my sister')
     expected = u'A m\xf8\xf8se once bit my sister'
     self.assertEquals(result, expected)