瀏覽代碼

fix test, clean singleton

nico 8 年之前
父節點
當前提交
ce35d236e2
共有 2 個文件被更改,包括 5 次插入0 次删除
  1. 2 0
      Tests/test_brain_loader.py
  2. 3 0
      Tests/test_rest_api.py

+ 2 - 0
Tests/test_brain_loader.py

@@ -16,6 +16,8 @@ from kalliope.core.Models.Settings import Settings
 class TestBrainLoader(unittest.TestCase):
 
     def setUp(self):
+        # be sure the brain haven't been instantiated before
+        Singleton._instances = {}
         if "/Tests" in os.getcwd():
             self.brain_to_test = os.getcwd() + os.sep + "brains/brain_test.yml"
         else:

+ 3 - 0
Tests/test_rest_api.py

@@ -14,6 +14,9 @@ from kalliope.core.RestAPI.FlaskAPI import FlaskAPI
 
 class TestRestAPI(LiveServerTestCase):
 
+    def tearDown(self):
+        Singleton._instances = {}
+
     def create_app(self):
         """
         executed once at the beginning of the test