MCPcopy Create free account
hub / github.com/Pylons/webtest / check_server

Function check_server

webtest/http.py:29–42  ·  view source on GitHub ↗

Perform a request until the server reply

(host, port, path_info='/', timeout=3, retries=30)

Source from the content-addressed store, hash-verified

27
28
29def check_server(host, port, path_info='/', timeout=3, retries=30):
30 """Perform a request until the server reply"""
31 if retries < 0:
32 return 0
33 time.sleep(.3)
34 for i in range(retries):
35 try:
36 conn = client.HTTPConnection(host, int(port), timeout=timeout)
37 conn.request('GET', path_info)
38 res = conn.getresponse()
39 return res.status
40 except (OSError, client.HTTPException):
41 time.sleep(.3)
42 return 0
43
44
45class StopableWSGIServer(TcpWSGIServer):

Callers 1

waitMethod · 0.85

Calls 1

requestMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…