26 lines
562 B
Python
26 lines
562 B
Python
from __future__ import annotations
|
|
|
|
import os
|
|
import subprocess
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
|
|
def test_main_runs_headless() -> None:
|
|
repo_root = Path(__file__).resolve().parents[1]
|
|
env = os.environ.copy()
|
|
env["AI_SIDEBAR_HEADLESS"] = "1"
|
|
|
|
result = subprocess.run(
|
|
[sys.executable, "main.py"],
|
|
cwd=repo_root,
|
|
env=env,
|
|
stdout=subprocess.PIPE,
|
|
stderr=subprocess.PIPE,
|
|
text=True,
|
|
check=False,
|
|
)
|
|
|
|
assert result.returncode == 0
|
|
assert "Headless mode enabled" in result.stdout
|