test_ansible_playbook.py 721 B

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