pbi-cli/tests/test_e2e.py
MinaSaad1 b777adec55 feat: v2.0.0 - replace MCP server with direct pythonnet/.NET TOM interop
Remove the MCP server binary dependency entirely. All 22 command groups now
connect directly to Power BI Desktop's Analysis Services engine via pythonnet
and bundled Microsoft.AnalysisServices DLLs (~20MB, in-process).

- Direct .NET TOM/ADOMD.NET interop for sub-second command execution
- 7 Claude Code skills (added Diagnostics and Partitions & Expressions)
- New commands: trace, transaction, calendar, expression, partition, advanced culture
- 91 tests passing, all skills updated, README/CHANGELOG rewritten
2026-03-27 07:19:21 +02:00

42 lines
937 B
Python

"""End-to-end tests requiring a running Power BI Desktop instance.
These tests are skipped in CI unless PBI Desktop is available.
Run with: pytest -m e2e
"""
from __future__ import annotations
import subprocess
import sys
import pytest
pytestmark = pytest.mark.e2e
def _pbi(*args: str) -> subprocess.CompletedProcess[str]:
"""Run a pbi command via subprocess."""
return subprocess.run(
[sys.executable, "-m", "pbi_cli", *args],
capture_output=True,
text=True,
timeout=30,
)
def test_version() -> None:
result = _pbi("--version")
assert result.returncode == 0
assert "pbi-cli" in result.stdout
def test_help() -> None:
result = _pbi("--help")
assert result.returncode == 0
assert "pbi-cli" in result.stdout
def test_setup_info() -> None:
result = _pbi("--json", "setup", "--info")
assert result.returncode == 0
assert "version" in result.stdout