示例#1
0
 def test_exception_to_unicode(self):
     msg = u'Message with unicode char \ua000 in the middle'
     exc = Exception(msg)
     result = log._ensure_unicode(exc)
     self.assertEqual(msg, result)
     self.assertIsInstance(result, six.text_type)
示例#2
0
 def test_exception_to_unicode(self):
     msg = u'Message with unicode char \ua000 in the middle'
     exc = Exception(msg)
     result = log._ensure_unicode(exc)
     self.assertEqual(msg, result)
     self.assertIsInstance(result, six.text_type)
示例#3
0
 def test_ascii_to_unicode(self):
     msg = u'Message with unicode char \ua000 in the middle'
     enc_msg = msg.encode('utf-8')
     result = log._ensure_unicode(enc_msg)
     self.assertEqual(msg, result)
     self.assertIsInstance(result, six.text_type)
示例#4
0
 def test_exception_to_unicode(self):
     msg = self._MSG
     exc = Exception(msg)
     result = log._ensure_unicode(exc)
     self.assertEqual(msg, result)
     self.assertIsInstance(result, six.text_type)
示例#5
0
 def test_ascii_to_unicode(self):
     msg = u'Message with unicode char \ua000 in the middle'
     enc_msg = msg.encode('utf-8')
     result = log._ensure_unicode(enc_msg)
     self.assertEqual(msg, result)
     self.assertIsInstance(result, six.text_type)
示例#6
0
 def test_unicode_to_unicode(self):
     msg = self._MSG
     result = log._ensure_unicode(msg)
     self.assertEqual(msg, result)
     self.assertIsInstance(result, six.text_type)
示例#7
0
 def test_ascii_to_unicode(self):
     msg = self._MSG
     enc_msg = msg.encode('utf-8')
     result = log._ensure_unicode(enc_msg)
     self.assertEqual(msg, result)
     self.assertIsInstance(result, six.text_type)
示例#8
0
 def test_exception_to_unicode(self):
     msg = self._MSG
     exc = Exception(msg)
     result = log._ensure_unicode(exc)
     self.assertEqual(msg, result)
     self.assertIsInstance(result, six.text_type)
示例#9
0
 def test_unicode_to_unicode(self):
     msg = self._MSG
     result = log._ensure_unicode(msg)
     self.assertEqual(msg, result)
     self.assertIsInstance(result, six.text_type)
示例#10
0
 def test_ascii_to_unicode(self):
     msg = self._MSG
     enc_msg = msg.encode('utf-8')
     result = log._ensure_unicode(enc_msg)
     self.assertEqual(msg, result)
     self.assertIsInstance(result, six.text_type)