Explorar o código

add test for singleton

nico %!s(int64=8) %!d(string=hai) anos
pai
achega
a0e736f6bf
Modificáronse 1 ficheiros con 7 adicións e 0 borrados
  1. 7 0
      core/Tests/test_brain_loader.py

+ 7 - 0
core/Tests/test_brain_loader.py

@@ -91,6 +91,13 @@ class TestBrainLoader(unittest.TestCase):
         self.assertEqual(order_from_bl, order_object)
         self.assertEqual(event_from_bl, event_object)
 
+    def test_singleton(self):
+        bl1 = BrainLoader.Instance(file_path=self.brain_to_test)
+        bl2 = BrainLoader.Instance(file_path=self.brain_to_test)
+
+        self.assertTrue(bl1.brain == bl2.brain)
+
+
 
 if __name__ == '__main__':
     unittest.main()