Пример #1
0
 def make_request_helper(self, started_event):
     """Helper method to make a request to the WSGI application in a subprocess."""
     # Let the operator know that we're about to make the HTTP request.
     logger.info("Making HTTP request to %s virtual host ..", self.name)
     # Let the parent process know we're ready to make the HTTP request.
     started_event.set()
     # Finally here's everything we wanted to do: It's a one liner :-P.
     urlopen(Request(self.manager.listen_addresses[0].url, None, dict(Host=self.name))).read()