Browse Source

[Tests] Add Say neuron param tests

monf 8 years ago
parent
commit
87942dffe8
2 changed files with 27 additions and 0 deletions
  1. 0 0
      neurons/say/tests/__init__.py
  2. 27 0
      neurons/say/tests/test_say.py

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


+ 27 - 0
neurons/say/tests/test_say.py

@@ -0,0 +1,27 @@
+import unittest
+
+from core.NeuronModule import MissingParameterException
+from neurons.say.say import Say
+
+
+class TestSay(unittest.TestCase):
+
+    def setUp(self):
+        self.message="message"
+        self.random = "random"
+
+    def testParameters(self):
+        def run_test(parameters_to_test):
+            with self.assertRaises(MissingParameterException):
+                Say(**parameters_to_test)
+
+        # empty
+        parameters = dict()
+        run_test(parameters)
+
+        # missing message
+        parameters = {
+            "random": self.random
+        }
+        run_test(parameters)
+