test_sleep.py 654 B

123456789101112131415161718192021222324252627282930
  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.second="second"
  7. self.random="random"
  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 second
  16. parameters = {
  17. "random": self.random
  18. }
  19. run_test(parameters)
  20. if __name__ == '__main__':
  21. unittest.main()