Esempio n. 1
0
    def test_to_str_with_specific_output_encoding(self):
        latin_1_bytes = u'ééé'.encode('latin-1')
        result = strings.to_str('ééé', out_enc='latin-1')

        if str == bytes:
            assert result == latin_1_bytes
        else:
            assert result == 'ééé'
Esempio n. 2
0
 def test_to_str_with_specific_input_encoding(self):
     latin_1_bytes = u'ééé'.encode('latin-1')
     result = strings.to_str(latin_1_bytes, in_enc='latin-1')
     assert result == 'ééé'
Esempio n. 3
0
 def test_to_str(self):
     for msg in self.all_strings:
         result = strings.to_str(msg)
         assert isinstance(result, str)