Changeset bdf5917 in mod_gnutls
- Timestamp:
- Jan 5, 2020, 3:52:55 AM (3 years ago)
- Branches:
- asyncio, main, master, proxy-ticket
- Children:
- 0b3733d
- Parents:
- fa14c32
- git-author:
- Fiona Klute <fiona.klute@…> (01/05/20 03:40:46)
- git-committer:
- Fiona Klute <fiona.klute@…> (01/05/20 03:52:55)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/mgstest/tests.py
rfa14c32 rbdf5917 329 329 """ 330 330 yaml_tag = '!request10' 331 status_re = re.compile('^HTTP/([\d\.]+) (\d+) (.*)$') 331 status_re = re.compile(r'^HTTP/([\d\.]+) (\d+) (.*)$') 332 header_re = re.compile(r'^([-\w]+):\s+(.*)$') 332 333 333 334 def __init__(self, **kwargs): … … 364 365 status, rest = outs.decode().split('\r\n', maxsplit=1) 365 366 # headers and body are separated by double newline 366 head ers, body = rest.split('\r\n\r\n', maxsplit=1)367 head, body = rest.split('\r\n\r\n', maxsplit=1) 367 368 # log response for debugging 368 print(f'{status}\n{head ers}\n\n{body}')369 print(f'{status}\n{head}\n\n{body}') 369 370 if response_log: 370 print(f'{status}\n{head ers}\n\n{body}', file=response_log)371 print(f'{status}\n{head}\n\n{body}', file=response_log) 371 372 372 373 m = self.status_re.match(status) … … 380 381 else: 381 382 raise TestExpectationFailed(f'Invalid status line: "{status}"') 383 384 if 'headers' in self.expect: 385 headers = dict() 386 for line in head.splitlines(): 387 m = self.header_re.fullmatch(line) 388 if m: 389 headers[m.group(1)] = m.group(2) 390 self.check_headers(headers) 382 391 383 392 if 'body' in self.expect:
Note: See TracChangeset
for help on using the changeset viewer.