Explorar o código

[Fix] Fix test encoding for python3

monf %!s(int64=8) %!d(string=hai) anos
pai
achega
1433592356
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  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),