pbi-cli/tests/test_commands/test_table.py
MinaSaad1 51a23668a7 feat: add REPL mode, test suite, CI/CD, and Claude Skills (Sprints 6-8)
Sprint 6 - REPL Mode + Polish:
- Error hierarchy (PbiCliError, McpToolError, etc.) for clean REPL error handling
- Interactive REPL with prompt-toolkit (persistent MCP connection, command completion, history)
- REPL-aware run_tool() and connection commands that reuse shared client
- README.md and CHANGELOG.md

Sprint 7 - Tests + CI/CD:
- 120 tests across unit, command, and e2e test files (79% coverage)
- MockPbiMcpClient with canned responses for test isolation
- GitHub Actions CI (lint + typecheck + test matrix: 3 OS x 3 Python)
- GitHub Actions release workflow for PyPI trusted publishing

Sprint 8 - Claude Skills + Installer:
- 5 bundled SKILL.md files (modeling, dax, deployment, security, docs)
- `pbi skills install/list/uninstall` command for Claude Code discovery
- Skills packaged with wheel via setuptools package-data
2026-03-26 13:54:24 +02:00

58 lines
1.4 KiB
Python

"""Tests for table commands."""
from __future__ import annotations
from pathlib import Path
from click.testing import CliRunner
from pbi_cli.main import cli
from tests.conftest import MockPbiMcpClient
def test_table_list(
cli_runner: CliRunner,
patch_get_client: MockPbiMcpClient,
tmp_connections: Path,
) -> None:
result = cli_runner.invoke(cli, ["--json", "table", "list"])
assert result.exit_code == 0
assert "Sales" in result.output
def test_table_get(
cli_runner: CliRunner,
patch_get_client: MockPbiMcpClient,
tmp_connections: Path,
) -> None:
result = cli_runner.invoke(cli, ["--json", "table", "get", "Sales"])
assert result.exit_code == 0
def test_table_create(
cli_runner: CliRunner,
patch_get_client: MockPbiMcpClient,
tmp_connections: Path,
) -> None:
result = cli_runner.invoke(cli, [
"--json", "table", "create", "NewTable", "--mode", "Import",
])
assert result.exit_code == 0
def test_table_delete(
cli_runner: CliRunner,
patch_get_client: MockPbiMcpClient,
tmp_connections: Path,
) -> None:
result = cli_runner.invoke(cli, ["--json", "table", "delete", "OldTable"])
assert result.exit_code == 0
def test_table_refresh(
cli_runner: CliRunner,
patch_get_client: MockPbiMcpClient,
tmp_connections: Path,
) -> None:
result = cli_runner.invoke(cli, ["--json", "table", "refresh", "Sales"])
assert result.exit_code == 0