927437a8d8
Sistema FleetView para centralizar la flota de procesos Claude Code vivos en una sola ventana kitty + tmux (socket aislado -L fleet) con un panel TUI: - list_claude_fleet (+ tipo claude_fleet): escanea ~/.claude/sessions + goals + runtime, valida procesos vivos (anti-PID-reciclado), join por sessionId. - list_resumable_claudes (+ tipo resumable_claude): sesiones cerradas reanudables. - wrappers tmux: tmux_new_claude_window (con --resume), tmux_swap_window_into_console (preserva ancho del sidebar), tmux_map_claude_panes. - launch_kittyclaude: comando entrypoint; instala atajos alt+flechas/enter/n/0/k/r, mouse on, remain-on-exit off; fija el ancho del sidebar con hooks. - docs/capabilities/claude-fleet.md + entrada en el INDEX. Incluye ademas funciones datascience en progreso (excel/duckdb/postgres) y ajustes varios de docs e infra de otra sesion, agrupados aqui para no perderlos. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
54 lines
1.5 KiB
Python
54 lines
1.5 KiB
Python
"""Tests para duckdb_table_schema."""
|
|
|
|
import os
|
|
import sys
|
|
|
|
sys.path.insert(0, os.path.dirname(__file__))
|
|
|
|
import duckdb # noqa: E402
|
|
|
|
from duckdb_table_schema import duckdb_table_schema # noqa: E402
|
|
|
|
|
|
def _make_db(path: str) -> None:
|
|
con = duckdb.connect(str(path))
|
|
con.execute(
|
|
"CREATE TABLE ventas (id BIGINT, region VARCHAR, total DOUBLE, ok BOOLEAN)"
|
|
)
|
|
con.close()
|
|
|
|
|
|
def test_schema_devuelve_columnas_y_tipos(tmp_path):
|
|
db = tmp_path / "v.duckdb"
|
|
_make_db(str(db))
|
|
res = duckdb_table_schema(str(db), "ventas")
|
|
assert res["status"] == "ok"
|
|
assert res["table"] == "ventas"
|
|
names = [c["name"] for c in res["columns"]]
|
|
types = {c["name"]: c["type"] for c in res["columns"]}
|
|
assert names == ["id", "region", "total", "ok"]
|
|
assert types["id"] == "BIGINT"
|
|
assert types["region"] == "VARCHAR"
|
|
assert types["total"] == "DOUBLE"
|
|
assert types["ok"] == "BOOLEAN"
|
|
|
|
|
|
def test_identificador_invalido_devuelve_status_error(tmp_path):
|
|
db = tmp_path / "v.duckdb"
|
|
_make_db(str(db))
|
|
res = duckdb_table_schema(str(db), "ventas; DROP TABLE ventas")
|
|
assert res["status"] == "error"
|
|
assert "invalid table identifier" in res["error"]
|
|
|
|
|
|
def test_tabla_inexistente_devuelve_status_error(tmp_path):
|
|
db = tmp_path / "v.duckdb"
|
|
_make_db(str(db))
|
|
res = duckdb_table_schema(str(db), "no_existe")
|
|
assert res["status"] == "error"
|
|
|
|
|
|
def test_db_inexistente_devuelve_status_error(tmp_path):
|
|
res = duckdb_table_schema(str(tmp_path / "noexiste.duckdb"), "ventas")
|
|
assert res["status"] == "error"
|