Adding additional tests to increase coverage
This commit is contained in:
parent
5372e6840f
commit
8ad28f8400
5 changed files with 116 additions and 1 deletions
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue