Esempio n. 1
0
    def test_is_running(self, monkeypatch):
        def errors():
            raise IOError

        monkeypatch.setattr(hooks, "celery_has_workers", errors)
        with pytest.raises(hooks.SystemCheckError):
            assert hooks.rabbitmq_is_running()
Esempio n. 2
0
    def test_is_running(self, monkeypatch):
        def errors():
            raise IOError

        monkeypatch.setattr(hooks, 'celery_has_workers', errors)
        with pytest.raises(hooks.SystemCheckError):
            assert hooks.rabbitmq_is_running()
Esempio n. 3
0
 def test_is_not_running(self, monkeypatch):
     monkeypatch.setattr(hooks, "celery_has_workers", lambda: None)
     assert hooks.rabbitmq_is_running() is None
Esempio n. 4
0
 def test_is_not_running(self, monkeypatch):
     monkeypatch.setattr(hooks, 'celery_has_workers', lambda: None)
     assert hooks.rabbitmq_is_running() is None