Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

1.4 KB
Raw Blame
from __future__ import annotations

import sys
from pathlib import Path

sys.path.insert(0, str(Path(__file__).resolve().parents[1]))

from config.v2_config import TelegramConfig


def test_telegram_config_proxy_url_default_none() -> None:
    """Test that proxy_url defaults to None when not specified."""
    config = TelegramConfig(bot_token="123456:test-token")
    assert config.proxy_url is None


def test_telegram_config_proxy_url_socks5() -> None:
    """Test that proxy_url can be set to SOCKS5 URL."""
    config = TelegramConfig(bot_token="123456:test-token", proxy_url="socks5://user:[email protected]:1080")
    assert config.proxy_url == "socks5://user:[email protected]:1080"


def test_telegram_config_proxy_url_http() -> None:
    """Test that proxy_url can be set to HTTP URL."""
    config = TelegramConfig(bot_token="123456:test-token", proxy_url="http://127.0.0.1:8080")
    assert config.proxy_url == "http://127.0.0.1:8080"


def test_telegram_config_proxy_url_socks4() -> None:
    """Test that proxy_url can be set to SOCKS4 URL."""
    config = TelegramConfig(bot_token="123456:test-token", proxy_url="socks4://127.0.0.1:1080")
    assert config.proxy_url == "socks4://127.0.0.1:1080"


def test_telegram_config_proxy_url_without_auth() -> None:
    """Test that proxy_url works without authentication."""
    config = TelegramConfig(bot_token="123456:test-token", proxy_url="socks5://127.0.0.1:1080")
    assert config.proxy_url == "socks5://127.0.0.1:1080"