test_shell.py 645 B

123456789101112131415161718192021222324252627282930
  1. import unittest
  2. from core.NeuronModule import MissingParameterException
  3. from neurons.shell.shell import Shell
  4. class TestShell(unittest.TestCase):
  5. def setUp(self):
  6. self.cmd="cmd"
  7. self.random="random"
  8. def testParameters(self):
  9. def run_test(parameters_to_test):
  10. with self.assertRaises(MissingParameterException):
  11. Shell(**parameters_to_test)
  12. # empty
  13. parameters = dict()
  14. run_test(parameters)
  15. # missing cmd
  16. parameters = {
  17. "random": self.random
  18. }
  19. run_test(parameters)
  20. if __name__ == '__main__':
  21. unittest.main()