Sfoglia il codice sorgente

[Tests] Fix brain loader local path

monf 8 anni fa
parent
commit
647a86abd0
2 ha cambiato i file con 7 aggiunte e 6 eliminazioni
  1. 1 1
      Tests/test_brain_loader.py
  2. 6 5
      Tests/test_tts_module.py

+ 1 - 1
Tests/test_brain_loader.py

@@ -9,7 +9,7 @@ from core.Models import Order
 class TestBrainLoader(unittest.TestCase):
 
     def setUp(self):
-        self.brain_to_test = "core/Tests/brains/brain_test.yml"
+        self.brain_to_test = "Tests/brains/brain_test.yml"
         self.expected_result = [
             {'signals': [{'order': 'test_order'}],
              'neurons': [{'say': {'message': ['test message']}}],

+ 6 - 5
Tests/test_tts_module.py

@@ -1,4 +1,5 @@
 import unittest
+import mock
 import os
 
 from core.TTS.TTSModule import TTSModule
@@ -46,13 +47,13 @@ class TestTTSModule(unittest.TestCase):
         """
         Test to generate and play sound
         """
-        def play_audio():
+        def new_play_audio():
             pass
 
-        # self.TTSMod.words = "kalliope"
-        # settings = Settings(cache_path="/tmp/kalliope/tests")
-        # self.TTSMod.settings = settings
-        # self.TTSMod.play_audio
+        with mock.patch.object(TTSModule, 'play_audio', new=new_play_audio):
+            self.TTSMod.words = "kalliope"
+            settings = Settings(cache_path="/tmp/kalliope/tests")
+            self.TTSMod.settings = settings
 
 
     def test_is_file_already_in_cache(self):