def make_webapp(self): listener = FakePostgresListenerService() service = webapp.WebApplicationService(0, listener, sentinel.status_worker) mock_makeEndpoint = self.patch(service, "_makeEndpoint") mock_makeEndpoint.return_value = TCP4ServerEndpoint( reactor, 0, interface="localhost") return service
def make_webapp(self): listener = FakePostgresListenerService() service_endpoint = self.make_endpoint() service = webapp.WebApplicationService( service_endpoint, listener, sentinel.status_worker) # Patch the getServiceNamed so the WebSocketFactory does not # error trying to register for events from the RPC service. In this # test the RPC service is not started. self.patch(eventloop.services, "getServiceNamed") return service