diff options
author | Nguyễn Gia Phong <cnx@loang.net> | 2025-05-29 16:00:00 +0900 |
---|---|---|
committer | Nguyễn Gia Phong <cnx@loang.net> | 2025-05-29 16:00:00 +0900 |
commit | 10cbbfad4b2796ed5afec1ea5f777149a2030f6a (patch) | |
tree | 1aaf0270dccb4243de66527ea48235f3426efd6d /tst/test_listen.py | |
parent | bd2898d5182ed4ac4e46f5035c6df765d59ad298 (diff) | |
download | scadere-10cbbfad4b2796ed5afec1ea5f777149a2030f6a.tar.gz |
Ensure base URL's trailing slash for path matching
Diffstat (limited to 'tst/test_listen.py')
-rw-r--r-- | tst/test_listen.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tst/test_listen.py b/tst/test_listen.py index 4d49ae2..ea58cc9 100644 --- a/tst/test_listen.py +++ b/tst/test_listen.py @@ -241,3 +241,11 @@ async def test_unallowed_method(base_url, request): await writer.drain() response = await reader.readuntil(b'\r\n') assert response == b'HTTP/1.1 405 Method Not Allowed\r\n' + + +@given(urls()) +def test_with_trailing_slash(base_url): + if base_url.endswith('/'): + assert with_trailing_slash(base_url) == base_url + else: + assert with_trailing_slash(base_url) == f'{base_url}/' |