def detect_test_from_requests(self, stream_mode=False):
"Check in raw first line of requests for an httpwookiee test marker."
detected = False
if stream_mode:
import six
block = six.text_type(self.stream)
else:
block = self.requests[0].first_line.raw.decode('utf8')
matches = re.match(r'.*httpw=--(.*)--.*',
block,
re.S)
if matches:
request_test_id = matches.group(1)
if self.test_id == request_test_id:
detected = True
return detected
评论列表
文章目录