def _wait_for_server_start(self):
"""
Wait for the mock service to be ready for requests.
:rtype: None
:raises RuntimeError: If there is a problem starting the mock service.
"""
s = requests.Session()
retries = Retry(total=15, backoff_factor=0.1)
s.mount('http://', HTTPAdapter(max_retries=retries))
resp = s.get(self.uri, headers=self.HEADERS)
if resp.status_code != 200:
self._process.terminate()
self._process.communicate()
raise RuntimeError(
'There was a problem starting the mock service: %s', resp.text)
评论列表
文章目录