Adding additional tests to increase coverage

This commit is contained in:
William Rubel 2019-02-16 20:53:27 -06:00
commit 8ad28f8400
5 changed files with 116 additions and 1 deletions

View file

@ -29,7 +29,6 @@ import re
from .compat import BaseClass
from .utils import decode_utf8
STATUSES = {
100: "Continue",
101: "Switching Protocols",
@ -134,6 +133,7 @@ def parse_requestline(s):
...
ValueError: Not a Request-Line
"""
methods = '|'.join(HttpBaseClass.METHODS)
m = re.match(r'(' + methods + ')\s+(.*)\s+HTTP/(1.[0|1])', s, re.I)
if m:
@ -146,6 +146,7 @@ def last_requestline(sent_data):
"""
Find the last line in sent_data that can be parsed with parse_requestline
"""
for line in reversed(sent_data):
try:
parse_requestline(decode_utf8(line))