def _get_client(self, host): """Return a vaurien client, or raise a ValueError if "name" doesn't exists. """ parts = urlparse(host) host, port = parts.netloc.split(':', -1) return Client(host, port)
def setUp(self): port = 8009 cmd = '%s -m vaurien.tests.support %s' % (sys.executable, port) self.process = Popen(cmd.split(' ')) # wait for the server to start time.sleep(1.) self.client = Client('localhost', port)
def setUp(self): self._proxy_pid = start_proxy(log_output='/dev/null', log_level='error') self._web = start_simplehttp_server() time.sleep(.2) try: if self._web.poll(): raise ValueError("Could not start the proxy") self.client = Client() assert self.client.get_behavior() == 'dummy' except Exception: self.tearDown() raise