Browse Source

[Fix] Fix test encoding for python3

monf 8 years ago
parent
commit
1433592356
1 changed files with 4 additions and 1 deletions
  1. 4 1
      Tests/test_utils.py

+ 4 - 1
Tests/test_utils.py

@@ -4,6 +4,8 @@
 import unittest
 import os
 
+import sys
+
 from kalliope.core.Models.Neuron import Neuron
 from kalliope.neurons.say.say import Say
 from kalliope.core.Utils.Utils import Utils
@@ -229,7 +231,8 @@ class TestUtils(unittest.TestCase):
         Test encoding the text in utf8
         """
         sentence = "kâllìöpé"
-        sentence = sentence.decode('utf8')
+        if sys.version_info[0] < 3:
+            sentence = sentence.decode('utf8')
         expected_sentence = "kâllìöpé"
 
         self.assertEqual(Utils.encode_text_utf8(text=sentence),