def _run_wsgi(self, workers=1):

        # Mock start method to check that children are started again on
        # receiving SIGHUP.
        with mock.patch("neutron.wsgi.WorkerService.start") as start_method:
            start_method.side_effect = self._fake_start

            server = wsgi.Server("Test")
            server.start(self.application, 0, "0.0.0.0",
                         workers=workers)

            # Memorize a port that was chosen for the service
            self.port = server.port
            os.write(self.pipeout, str(self.port))

            server.wait()
Start WSGI server with a test application.
dataset/ETHPy150Open openstack/neutron/neutron/tests/functional/test_server.py/TestWsgiServer._run_wsgi