4b6817381b
CI (OpenClaw E2E) / openclaw test (push) Has been cancelled
CI / coverage-report (push) Has been cancelled
CI / test-kubernetes (push) Has been cancelled
CI / should-run-thorough (push) Has been cancelled
CI / test-thorough (cloudwatch-demo) (push) Has been cancelled
CI / test-thorough (flink-ecs) (push) Has been cancelled
CI / test-thorough (upstream-lambda) (push) Has been cancelled
CI / test-thorough (prefect-ecs-fargate) (push) Has been cancelled
Release / build-binaries (zip, opensre.exe, onefile, windows-latest, windows-x64) (push) Has been cancelled
Benchmark image — build + push to ECR (any adapter) / build + push (push) Has been cancelled
CI / quality (ubuntu-latest) (push) Has been cancelled
CI / test (tools-runtime) (push) Has been cancelled
CI / test (e2e-general) (push) Has been cancelled
CI / test (cli-runtime) (push) Has been cancelled
CI / test (e2e-provider-and-openclaw) (push) Has been cancelled
CI / test (integrations-and-misc) (push) Has been cancelled
Release / verify (push) Has been cancelled
Release / build-python-dist (push) Has been cancelled
Release / build-binaries (tar.gz, opensre, onedir, macos-15-intel, darwin-x64) (push) Has been cancelled
Release / build-binaries (tar.gz, opensre, onedir, macos-latest, darwin-arm64) (push) Has been cancelled
Release / build-binaries (tar.gz, opensre, onedir, ubuntu-22.04, linux-x64) (push) Has been cancelled
Release / publish-release (push) Has been cancelled
Release / publish-main-release (push) Has been cancelled
Interactive Shell Live (PR + post-merge) / turn-checks (no-LLM) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Interactive Shell Live (PR + post-merge) / turn-live shard ${{ matrix.shard_index }} (push) Has been cancelled
Release / prepare (push) Has been cancelled
Release / build-binaries (tar.gz, opensre, onedir, ubuntu-22.04-arm, linux-arm64) (push) Has been cancelled
Synthetic Deterministic Tests / Synthetic offline (deterministic) (push) Has been cancelled
69 lines
2.7 KiB
Python
69 lines
2.7 KiB
Python
"""Regression tests for wizard path constants."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from surfaces.cli.wizard.config import (
|
|
ANTHROPIC_MODELS,
|
|
CLAUDE_CODE_MODELS,
|
|
PROJECT_ENV_PATH,
|
|
PROJECT_ROOT,
|
|
SUPPORTED_PROVIDERS,
|
|
)
|
|
from surfaces.cli.wizard.flow import _onboarding_provider_options
|
|
|
|
|
|
def test_project_env_path_defaults_to_repo_root() -> None:
|
|
"""PROJECT_ROOT must resolve to the checkout root, not its parent directory."""
|
|
assert (PROJECT_ROOT / "pyproject.toml").is_file()
|
|
assert PROJECT_ENV_PATH == PROJECT_ROOT / ".env"
|
|
|
|
|
|
def test_provider_catalog_keeps_legacy_cli_providers_registered() -> None:
|
|
"""Legacy CLI provider values remain registered for existing configs."""
|
|
labels_by_value = {provider.value: provider.label for provider in SUPPORTED_PROVIDERS}
|
|
values = [provider.value for provider in SUPPORTED_PROVIDERS]
|
|
|
|
assert labels_by_value["anthropic"] == "Anthropic API key"
|
|
assert labels_by_value["claude-code"] == "Anthropic Claude Code CLI"
|
|
assert values.index("anthropic") < values.index("claude-code") < values.index("openai")
|
|
|
|
assert labels_by_value["openai"] == "OpenAI API key"
|
|
assert labels_by_value["codex"] == "OpenAI Codex CLI"
|
|
assert values.index("openai") < values.index("codex") < values.index("openrouter")
|
|
|
|
assert labels_by_value["gemini"] == "Google Gemini API key"
|
|
assert labels_by_value["gemini-cli"] == "Google Gemini CLI"
|
|
assert labels_by_value["antigravity-cli"] == "Google Antigravity CLI"
|
|
assert (
|
|
values.index("gemini")
|
|
< values.index("gemini-cli")
|
|
< values.index("antigravity-cli")
|
|
< values.index("nvidia")
|
|
)
|
|
|
|
assert labels_by_value["groq"] == "Groq API key"
|
|
assert labels_by_value["grok-cli"] == "xAI Grok Build CLI"
|
|
assert values.index("groq") < values.index("grok-cli") < values.index("cursor")
|
|
|
|
|
|
def test_claude_fable_5_is_selectable_without_custom_models() -> None:
|
|
"""#3621: anthropic keeps a curated list, so Fable 5 must be in it explicitly."""
|
|
anthropic_values = [model.value for model in ANTHROPIC_MODELS]
|
|
claude_code_values = [model.value for model in CLAUDE_CODE_MODELS]
|
|
|
|
assert "claude-fable-5" in anthropic_values
|
|
assert "claude-fable-5" in claude_code_values
|
|
# Defaults stay unchanged: Fable 5 is pricier and opt-in only.
|
|
assert anthropic_values[0] != "claude-fable-5"
|
|
assert claude_code_values[0] == ""
|
|
|
|
|
|
def test_onboarding_provider_options_hide_openai_anthropic_oauth_backends() -> None:
|
|
"""Onboarding presents OpenAI/Anthropic auth methods under the provider."""
|
|
values = [provider.value for provider in _onboarding_provider_options()]
|
|
|
|
assert "anthropic" in values
|
|
assert "openai" in values
|
|
assert "claude-code" not in values
|
|
assert "codex" not in values
|