test_gmail_checker.py 836 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import unittest
  2. from core.NeuronModule import MissingParameterException
  3. from neurons.gmail_checker.gmail_checker import Gmail_checker
  4. class TestGmail_Checker(unittest.TestCase):
  5. def setUp(self):
  6. self.username="username"
  7. self.password="password"
  8. def testParameters(self):
  9. def run_test(parameters_to_test):
  10. with self.assertRaises(MissingParameterException):
  11. Gmail_checker(**parameters_to_test)
  12. # empty
  13. parameters = dict()
  14. run_test(parameters)
  15. # missing password
  16. parameters = {
  17. "username": self.username
  18. }
  19. run_test(parameters)
  20. # missing username
  21. parameters = {
  22. "password": self.password
  23. }
  24. run_test(parameters)
  25. if __name__ == '__main__':
  26. unittest.main()