Browse Source

[Tests] Add gmail_checker param tests

monf 8 years ago
parent
commit
b473f5c1da

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


+ 33 - 0
neurons/gmail_checker/tests/test_gmail_checker.py

@@ -0,0 +1,33 @@
+import unittest
+
+from core.NeuronModule import MissingParameterException
+from neurons.gmail_checker.gmail_checker import Gmail_checker
+
+
+class TestGmail_Checker(unittest.TestCase):
+
+    def setUp(self):
+        self.username="username"
+        self.password="password"
+
+    def testParameters(self):
+        def run_test(parameters_to_test):
+            with self.assertRaises(MissingParameterException):
+                Gmail_checker(**parameters_to_test)
+
+        # empty
+        parameters = dict()
+        run_test(parameters)
+
+        # missing password
+        parameters = {
+            "username": self.username
+        }
+        run_test(parameters)
+
+        # missing username
+        parameters = {
+           "password": self.password
+        }
+        run_test(parameters)
+