Ejemplo n.º 1
0
 def test_number_should_be_encoded(self):
     result = decode_to_unicode(42)
     self.assertEquals(result, "42")
Ejemplo n.º 2
0
 def test_none_should_be_returned_unchanged(self):
     result = decode_to_unicode(None)
     self.assertTrue(result is None)
Ejemplo n.º 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))
Ejemplo n.º 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)
Ejemplo n.º 5
0
 def test_number_should_be_encoded(self):
     result = decode_to_unicode(42)
     self.assertEquals(result, "42")
Ejemplo n.º 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))
Ejemplo n.º 7
0
 def test_none_should_be_returned_unchanged(self):
     result = decode_to_unicode(None)
     self.assertTrue(result is None)
Ejemplo n.º 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)