Skip to content

Commit d51417a

Browse files
committed
Chore: Add software test about trailing slash on HTTP URL
1 parent 5185821 commit d51417a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/test_mcp.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ def test_query_sql_permitted():
3737
assert query_sql("SELECT 42")["rows"] == [[42]]
3838

3939

40+
def test_query_sql_trailing_slash(mocker):
41+
"""Verify that query_sql works correctly when HTTP_URL has a trailing slash."""
42+
mocker.patch("cratedb_mcp.__main__.HTTP_URL", "http://localhost:4200/")
43+
assert query_sql("SELECT 42")["rows"] == [[42]]
44+
45+
4046
def test_query_sql_forbidden_easy():
4147
with pytest.raises(PermissionError) as ex:
4248
assert "RelationUnknown" in str(

0 commit comments

Comments
 (0)