test.py 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # coding=utf-8
  2. from core import ConfigurationManager
  3. from core.ConfigurationManager.BrainLoader import BrainLoader
  4. from core.CrontabManager import CrontabManager
  5. from core.NeuroneLauncher import NeuroneLauncher
  6. from core.OrderAnalyser import OrderAnalyser
  7. from core.OrderListener import OrderListener
  8. from neurons import Say
  9. from neurons.ansible_tasks.ansible_tasks import Ansible_tasks
  10. import logging
  11. from core import ShellGui
  12. from crontab import CronSlices
  13. # oa = OrderAnalyser("dis bonjour", brain_file="test.yml")
  14. #
  15. # oa.start()
  16. # test
  17. # cron_manager = CrontabManager()
  18. # cron_manager.load_events_in_crontab()
  19. class NoEventsFound(Exception):
  20. pass
  21. class NoIdInEvent(Exception):
  22. pass
  23. class NoPeriodInEvent(Exception):
  24. pass
  25. # events = BrainLoader(filename="test.yml").get_events()
  26. #
  27. # # check there is some event in the brain file
  28. # if len(events) <= 0:
  29. # raise NoEventsFound("There is no events in the brain file")
  30. #
  31. # # we must check that each event has an id and a period
  32. # for event in events:
  33. # if "id" not in event:
  34. # raise NoIdInEvent("No id found event must has an unique id")
  35. # if "period" not in event:
  36. # raise NoPeriodInEvent("An event must has a period")
  37. brain = BrainLoader(filename="test.yml").get_brain()