about summary refs log tree commit diff
path: root/tst/test_listen.py
diff options
context:
space:
mode:
authorNguyễn Gia Phong <cnx@loang.net>2025-05-29 16:00:00 +0900
committerNguyễn Gia Phong <cnx@loang.net>2025-05-29 16:00:00 +0900
commit10cbbfad4b2796ed5afec1ea5f777149a2030f6a (patch)
tree1aaf0270dccb4243de66527ea48235f3426efd6d /tst/test_listen.py
parentbd2898d5182ed4ac4e46f5035c6df765d59ad298 (diff)
downloadscadere-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.py8
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}/'