test_tasker_autoremote.py 766 B

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