Files
Orchestrator/bahn/teamlandkarte-mcp/tests/test_read_only_guard.py
T
ankn a5f8fb49ab Migrate all repos into monorepo context folders
Bahn: aisupport, Analyse-O2C-C2S, awesome-bahn-mcp-servers, beam-mcp,
      Confluence_Bot, db-planet-mcp-server, O2C-Harness, project-audit,
      Projekt-KIQ-HP, teamlandkarte-mcp
Dhive: Jury-Voting
Privat: CV, NoteGraph (NOTE: NoteGraph needs complete redo after consolidation)
Shared: AI-Orchestrator, OrgMyLife, power_skills_and_more
Shared/references: symphony (read-only)

Bahn repos remain available as independent remotes - this monorepo
pulls them in via subtree, the originals are untouched.
2026-06-30 20:39:52 +02:00

24 lines
502 B
Python

from __future__ import annotations
import pytest
import teamlandkarte_mcp.database.read_only as ro
def test_ensure_select_only_allows_select() -> None:
ro.ensure_select_only("SELECT 1")
@pytest.mark.parametrize(
"sql",
[
"DELETE FROM t",
"UPDATE t SET x = 1",
"INSERT INTO t VALUES (1)",
"DROP TABLE t",
],
)
def test_ensure_select_only_rejects_writes(sql: str) -> None:
with pytest.raises(ro.DatabaseError):
ro.ensure_select_only(sql)