Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions tests/test_mcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ def test_query_sql_permitted():
assert query_sql("SELECT 42")["rows"] == [[42]]


def test_query_sql_trailing_slash(mocker):
"""Verify that query_sql works correctly when HTTP_URL has a trailing slash."""
mocker.patch("cratedb_mcp.__main__.HTTP_URL", "http://localhost:4200/")
assert query_sql("SELECT 42")["rows"] == [[42]]


def test_query_sql_forbidden_easy():
with pytest.raises(PermissionError) as ex:
assert "RelationUnknown" in str(
Expand Down