def test_main(self): manila_all.main() self._common_checks() self.assertFalse(self.fake_log.exception.called) self.assertTrue( service.process_launcher.return_value.launch_service.called) self.assertTrue(service.process_launcher.return_value.wait.called)
def test_main_wsgi_service_osapi_share_exception(self, exc): service.WSGIService.side_effect = exc manila_all.main() self._common_checks() self.fake_log.exception.assert_called_once_with(mock.ANY) service.serve.assert_has_calls([mock.call(*[self.service] * 3)])
def test_main_service_create_exception(self, exc): service.Service.create.side_effect = exc manila_all.main() self._common_checks() self.fake_log.exception.assert_has_calls(mock.ANY) service.serve.assert_has_calls([mock.call(self.wsgi_service)])
def test_main(self): manila_all.main() self._common_checks() self.assertFalse(self.fake_log.exception.called) service.serve.assert_has_calls([ mock.call(self.wsgi_service, *[self.service] * 3) ])
def test_main_raise_exception(self, exc, exc_in_wsgi): if exc_in_wsgi: service.WSGIService.side_effect = exc else: service.Service.create.side_effect = exc manila_all.main() self._common_checks() self.fake_log.exception.assert_has_calls([mock.ANY])