tests: Strip trailing slash for webserver paths.
This commit is contained in:
parent
24a71e5c2e
commit
7cfea665ff
@ -53,6 +53,9 @@ def test_httpbin(httpbin, qtbot, path, content, expected):
|
||||
@pytest.mark.parametrize('line, verb, path, equal', [
|
||||
('127.0.0.1 - - [01/Jan/1990 00:00:00] "GET / HTTP/1.1" 200 -',
|
||||
'GET', '/', True),
|
||||
('127.0.0.1 - - [01/Jan/1990 00:00:00] "GET /foo/ HTTP/1.1" 200 -',
|
||||
'GET', '/foo', True),
|
||||
|
||||
('127.0.0.1 - - [01/Jan/1990 00:00:00] "GET / HTTP/1.1" 200 -',
|
||||
'GET', '/foo', False),
|
||||
('127.0.0.1 - - [01/Jan/1990 00:00:00] "GET / HTTP/1.1" 200 -',
|
||||
|
@ -73,7 +73,9 @@ class Request(testprocess.Line):
|
||||
assert match.group('protocol') == 'HTTP/1.1'
|
||||
assert self.verb == 'GET'
|
||||
|
||||
self.path = match.group('path')
|
||||
path = match.group('path')
|
||||
self.path = '/' if path == '/' else path.rstrip('/')
|
||||
|
||||
self.status = int(match.group('status'))
|
||||
|
||||
missing_paths = ['/favicon.ico', '/does-not-exist']
|
||||
|
Loading…
Reference in New Issue
Block a user