コード例 #1
0
    def test_latin_str_to_unicode(self, sys_mock):
        sys_mock.getfilesystemencoding.return_value = 'iso-8859-16'

        test_data = 'czegoś' if six.PY3 else u'czegoś'.encode('iso-8859-16')
        expected_data = test_data if six.PY3 else u'czegoś'
        result = utils.str_to_unicode(test_data)
        self.assertIsInstance(result, six.text_type)
        self.assertEqual(result, expected_data)
コード例 #2
0
 def test_latin_str_to_unicode(self, _):
     test_data = 'czegoś' if six.PY3 else u'czegoś'.encode('iso-8859-16')
     expected_data = test_data if six.PY3 else u'czegoś'
     result = utils.str_to_unicode(test_data)
     self.assertIsInstance(result, six.text_type)
     self.assertEqual(result, expected_data)
コード例 #3
0
 def test_str_to_unicode(self, _):
     test_data = 'тест'
     expected_data = test_data if six.PY3 else u'тест'
     result = utils.str_to_unicode(test_data)
     self.assertIsInstance(result, six.text_type)
     self.assertEqual(result, expected_data)
コード例 #4
0
 def test_latin_str_to_unicode(self, _):
     test_data = 'czegoś' if six.PY3 else u'czegoś'.encode('iso-8859-16')
     expected_data = test_data if six.PY3 else u'czegoś'
     result = utils.str_to_unicode(test_data)
     self.assertIsInstance(result, six.text_type)
     self.assertEqual(result, expected_data)