test_list.py 687 B

1234567891011121314151617181920212223242526
  1. from __future__ import absolute_import, unicode_literals
  2. import io
  3. import pytest
  4. from case import Mock
  5. from celery.bin.base import Error
  6. from celery.bin.list import list_
  7. class test_list:
  8. def test_list_bindings_no_support(self):
  9. l = list_(app=self.app, stderr=io.StringIO())
  10. management = Mock()
  11. management.get_bindings.side_effect = NotImplementedError()
  12. with pytest.raises(Error):
  13. l.list_bindings(management)
  14. def test_run(self):
  15. l = list_(app=self.app, stderr=io.StringIO())
  16. l.run('bindings')
  17. with pytest.raises(Error):
  18. l.run(None)
  19. with pytest.raises(Error):
  20. l.run('foo')