Files
mistral-vibe/tests/acp/test_utils.py
Mathias Gesbert ec7f3b25ea v2.2.0 (#395)
Co-authored-by: Quentin Torroba <quentin.torroba@mistral.ai>
Co-authored-by: Clément Siriex <clement.sirieix@mistral.ai>
Co-authored-by: Kim-Adeline Miguel <kimadeline.miguel@mistral.ai>
Co-authored-by: Michel Thomazo <michel.thomazo@mistral.ai>
Co-authored-by: Clément Drouin <clement.drouin@mistral.ai>
2026-02-17 16:23:28 +01:00

56 lines
1.7 KiB
Python

from __future__ import annotations
from vibe.acp.utils import get_proxy_help_text
from vibe.core.paths.global_paths import GLOBAL_ENV_FILE
from vibe.core.proxy_setup import SUPPORTED_PROXY_VARS
def _write_env_file(content: str) -> None:
GLOBAL_ENV_FILE.path.parent.mkdir(parents=True, exist_ok=True)
GLOBAL_ENV_FILE.path.write_text(content, encoding="utf-8")
class TestGetProxyHelpText:
def test_returns_string(self) -> None:
result = get_proxy_help_text()
assert isinstance(result, str)
def test_includes_proxy_configuration_header(self) -> None:
result = get_proxy_help_text()
assert "## Proxy Configuration" in result
def test_includes_usage_section(self) -> None:
result = get_proxy_help_text()
assert "### Usage:" in result
assert "/proxy-setup" in result
def test_includes_all_supported_variables(self) -> None:
result = get_proxy_help_text()
for key in SUPPORTED_PROXY_VARS:
assert f"`{key}`" in result
def test_shows_none_configured_when_no_settings(self) -> None:
result = get_proxy_help_text()
assert "(none configured)" in result
def test_shows_current_settings_when_configured(self) -> None:
_write_env_file("HTTP_PROXY=http://proxy:8080\n")
result = get_proxy_help_text()
assert "HTTP_PROXY=http://proxy:8080" in result
assert "(none configured)" not in result
def test_shows_only_set_values(self) -> None:
_write_env_file("HTTP_PROXY=http://proxy:8080\n")
result = get_proxy_help_text()
assert "HTTP_PROXY=http://proxy:8080" in result
assert "HTTPS_PROXY=" not in result