Tests: more perl tests.

This commit is contained in:
Andrey Zelenkov
2018-02-26 19:53:40 +03:00
parent 6d79c559b5
commit a89747e97c
4 changed files with 39 additions and 2 deletions

View File

@@ -237,7 +237,13 @@ class TestUnitHTTP(TestUnit):
headers = {}
for line in headers_lines:
m = re.search('(.*)\:\s(.*)', line)
headers[m.group(1)] = m.group(2)
if m.group(1) not in headers:
headers[m.group(1)] = m.group(2)
elif isinstance(headers[m.group(1)], list):
headers[m.group(1)].append(m.group(2))
else:
headers[m.group(1)] = [headers[m.group(1)], m.group(2)]
return {
'status': int(status),