def test_stop(self): """ Test stop action """ zdb = Zerodb('zdb', data=self.valid_data) zdb.state.set('actions', 'install', 'ok') zdb.api.services.get = MagicMock() zdb.stop() zdb._zerodb_sal.stop.assert_called_once_with()
def test_stop_before_install(self): """ Test stop action without install """ with pytest.raises( StateCheckError, message= 'stop action should raise an error if zerodb is not installed' ): zdb = Zerodb('zdb', data=self.valid_data) zdb.stop()
def test_stop(self): """ Test stop action """ zdb = Zerodb('zdb', data=self.valid_data) zdb.stop() zdb._zerodb_sal.stop.assert_called_once_with() with pytest.raises(StateCheckError, message='state status/running should not be present after stop'): zdb.state.check('status', 'running', 'ok') with pytest.raises(StateCheckError, message='state action/install should not be present after stop'): zdb.state.check('actions', 'start', 'ok')
def test_stop_before_start(self): """ Test stop action without install """ zdb = Zerodb('zdb', data=self.valid_data) zdb.stop()