Browse Source

[Tests] Add Sleep neuron param tests

monf 8 years ago
parent
commit
ee2e417ce7
2 changed files with 30 additions and 0 deletions
  1. 0 0
      neurons/sleep/tests/__init__.py
  2. 30 0
      neurons/sleep/tests/test_sleep.py

+ 0 - 0
neurons/sleep/tests/__init__.py


+ 30 - 0
neurons/sleep/tests/test_sleep.py

@@ -0,0 +1,30 @@
+import unittest
+
+from core.NeuronModule import MissingParameterException
+from neurons.sleep.sleep import Sleep
+
+
+class TestSleep(unittest.TestCase):
+
+    def setUp(self):
+        self.second="second"
+        self.random="random"
+
+    def testParameters(self):
+        def run_test(parameters_to_test):
+            with self.assertRaises(MissingParameterException):
+                Sleep(**parameters_to_test)
+
+        # empty
+        parameters = dict()
+        run_test(parameters)
+
+        # missing second
+        parameters = {
+            "random": self.random
+        }
+        run_test(parameters)
+
+
+if __name__ == '__main__':
+    unittest.main()