def get_outgoing_webhook_service_handler(service: Service) -> Any: service_interface_class = get_service_interface_class(service.interface_name()) service_interface = service_interface_class(token=service.token, user_profile=service.user_profile, service_name=service.name) return service_interface
def get_outgoing_webhook_service_handler(service: Service) -> Any: service_interface_class = get_service_interface_class(service.interface_name()) service_interface = service_interface_class( token=service.token, user_profile=service.user_profile, service_name=service.name ) return service_interface
success_response, _ = self.handler.process_success( response, self.event) self.assertEqual(success_response, None) response.text = json.dumps({"response_string": 'test_content'}) success_response, _ = self.handler.process_success( response, self.event) self.assertEqual(success_response, 'test_content') response.text = json.dumps({}) success_response, _ = self.handler.process_success( response, self.event) self.assertEqual(success_response, None) mock_service = Service() class TestSlackOutgoingWebhookService(ZulipTestCase): def setUp(self) -> None: self.event = { u'command': '@**test**', u'user_profile_id': 12, u'service_name': 'test-service', u'trigger': 'mention', u'message': { 'content': 'test_content', 'type': 'stream', 'sender_realm_str': 'zulip', 'sender_email': '*****@*****.**', 'stream_id': '123',