test_poller.py 757 B

123456789101112131415161718192021
  1. # -*- coding: utf-8 -*-
  2. def test_local_poll(pepper_cli, session_minion_id):
  3. '''Test the returns poller for localclient'''
  4. ret = pepper_cli('--fail-if-incomplete', '*', 'test.sleep', '1')
  5. assert ret[session_minion_id] is True
  6. assert len(ret) == 1
  7. def test_local_poll_long(pepper_cli, session_minion_id):
  8. '''Test the returns poller for localclient'''
  9. ret = pepper_cli('--fail-if-incomplete', '*', 'test.sleep', '30')
  10. assert ret[session_minion_id] is True
  11. assert len(ret) == 1
  12. def test_local_poll_timeout(pepper_cli, session_minion_id):
  13. '''Test the returns poller for localclient'''
  14. ret = pepper_cli('--timeout=5', '--fail-if-incomplete', '*', 'test.sleep', '30')
  15. assert ret == {'Failed': [session_minion_id]}