فهرست منبع

[Tests] add first raw of TTSModule tests

monf 8 سال پیش
والد
کامیت
24beb3253c
4فایلهای تغییر یافته به همراه29 افزوده شده و 9 حذف شده
  1. 0 2
      core/Tests/test_brain_loader.py
  2. 5 5
      core/Tests/test_dynamic_loading.py
  3. 0 2
      core/Tests/test_settings_loader.py
  4. 24 0
      core/Tests/test_tts_module.py

+ 0 - 2
core/Tests/test_brain_loader.py

@@ -1,11 +1,9 @@
 import unittest
 
 from core.ConfigurationManager import BrainLoader
-from core.Models import Brain
 from core.Models import Event
 from core.Models import Neuron
 from core.Models import Order
-from core.Models import Synapse
 
 
 class TestBrainLoader(unittest.TestCase):

+ 5 - 5
core/Tests/test_dynamic_loading.py

@@ -32,7 +32,7 @@ class TestDynamicLoading(unittest.TestCase):
         # get trigger dir
         self.trigger_dir = os.path.normpath(root_dir + os.sep + "trigger")
 
-    def test_01_packages_present(self):
+    def test_packages_present(self):
         """
         Check that the neurons folder exist in the root of the project
         """
@@ -41,7 +41,7 @@ class TestDynamicLoading(unittest.TestCase):
         self.assertTrue(os.path.isdir(self.tts_dir))
         self.assertTrue(os.path.isdir(self.trigger_dir))
 
-    def test_02_can_import_neurons(self):
+    def test_can_import_neurons(self):
         """
         Try to import each neurons that are present in the neurons package
         :return:
@@ -52,7 +52,7 @@ class TestDynamicLoading(unittest.TestCase):
             module_name = neuron_name.capitalize()
             self.dynamic_import(package_name, module_name)
 
-    def test_03_can_import_stt(self):
+    def test_can_import_stt(self):
         """
         Try to import each stt that are present in the stt package
         :return:
@@ -63,7 +63,7 @@ class TestDynamicLoading(unittest.TestCase):
             module_name = stt_name.capitalize()
             self.dynamic_import(package_name, module_name)
 
-    def test_04_can_import_tts(self):
+    def test_can_import_tts(self):
         """
         Try to import each tts that are present in the tts package
         :return:
@@ -74,7 +74,7 @@ class TestDynamicLoading(unittest.TestCase):
             module_name = tts_name.capitalize()
             self.dynamic_import(package_name, module_name)
 
-    def test_05_can_import_trigger(self):
+    def test_can_import_trigger(self):
         """
         Try to import each trigger that are present in the trigger package
         :return:

+ 0 - 2
core/Tests/test_settings_loader.py

@@ -1,9 +1,7 @@
-import platform
 import unittest
 
 from core.ConfigurationManager import SettingLoader
 from core.Models.RestAPI import RestAPI
-from core.Models.Settings import Settings
 from core.Models.Stt import Stt
 from core.Models.Trigger import Trigger
 from core.Models.Tts import Tts

+ 24 - 0
core/Tests/test_tts_module.py

@@ -0,0 +1,24 @@
+import unittest
+
+from core.TTS.TTSModule import TTSModule
+
+
+class TestTTSModule(unittest.TestCase):
+    """
+    Class to test TTSModule
+    """
+
+    def setUp(self):
+        self.TTSMod = TTSModule(language='tests')
+        pass
+
+    def test_generate_md5_from_words(self):
+        """
+        Test generate md5 method
+        """
+        word = "kalliope"
+        expected_result = "5c186d1e123be2667fb5fd54640e4fd0"
+
+        self.assertEquals(TTSModule.generate_md5_from_words(words=word),
+                          expected_result,
+                          "Fail md5")