opencode-config/tests/test_cli.py
Sergey 6005c88203
feat: migrate src/ second-brain + tests + python tooling (#17)
* feat(src): migrate second-brain RAG CLI + tests

* fix(embedder): strip hardcoded ai.slaid098.dev endpoint

* refactor: rename slaid098/opencode to opencode-config

* docs(handoff): add pr-5 handoff + ADR-001

* fix(docs): rebase handoff/ADR naming to PR number + drop dangling ADR-009 refs

* fix(tests): update script paths + assertions for opencode-config migration

* fix(pyproject): update cov + ruff paths config/scripts -> .opencode/scripts

* docs: update project map + handoff + ADR

---------

Co-authored-by: opencode-agent <agent@slaid098.dev>
2026-07-23 23:17:18 +03:00

35 lines
773 B
Python

import subprocess
import sys
def test_cli_download() -> None:
result = subprocess.run(
[sys.executable, "-m", "src.memory", "download"],
capture_output=True,
text=True,
check=False,
)
assert result.returncode == 0
assert "not needed" in result.stdout
def test_cli_search_no_index(tmp_path) -> None:
result = subprocess.run(
[
sys.executable,
"-m",
"src.memory",
"search",
"test query",
"-i",
str(tmp_path),
"-k",
"5",
"--json",
],
capture_output=True,
text=True,
check=False,
)
assert result.returncode == 0
assert result.stdout.strip() == "[]"