Import AITURK IDE 1.0.0-beta.1 from Hermes 63279301; preserve MIT license

This commit is contained in:
2026-09-05 13:26:46 +03:00
commit 03634b1ca3
11340 changed files with 3442369 additions and 0 deletions
@@ -0,0 +1,43 @@
"""#69283: kanban write guard prevents tests from writing to real ~/.hermes."""
from __future__ import annotations
import pytest
from hermes_cli import kanban_db
def test_connect_succeeds_under_test_home(tmp_path, monkeypatch):
"""When HERMES_HOME is a temp dir, kanban connect succeeds normally."""
home = tmp_path / "hermes_home"
home.mkdir()
monkeypatch.setenv("HERMES_HOME", str(home))
conn = kanban_db.connect()
try:
assert str(kanban_db.kanban_db_path()).startswith(str(home))
finally:
conn.close()
def test_connect_raises_when_kanban_home_is_real_root(monkeypatch):
"""When kanban paths resolve to the REAL root, connect raises RuntimeError."""
import tests.conftest as _conftest
monkeypatch.setattr(
kanban_db, "kanban_home", lambda: _conftest._REAL_KANBAN_ROOT
)
monkeypatch.setattr(
kanban_db,
"kanban_db_path",
lambda board=None: _conftest._REAL_KANBAN_ROOT / "kanban.db",
)
with pytest.raises(RuntimeError, match="kanban_write_guard"):
kanban_db.connect()
def test_connect_raises_for_explicit_db_path_under_real_root():
"""Explicit db_path pointing under the real root is also refused."""
import tests.conftest as _conftest
with pytest.raises(RuntimeError, match="kanban_write_guard"):
kanban_db.connect(_conftest._REAL_KANBAN_ROOT / "kanban.db")