from bot_descarga.ui.settings_store import DEFAULT_API_URL, normalize_api_url def test_default_api_is_pys1(): assert "pys1.builker.xyz" in DEFAULT_API_URL assert DEFAULT_API_URL.rstrip("/").endswith("bot-descarga") or "/bot-descarga" in DEFAULT_API_URL def test_normalize_adds_prefix(): assert normalize_api_url("https://pys1.builker.xyz") == "https://pys1.builker.xyz/bot-descarga" assert ( normalize_api_url("https://pys1.builker.xyz/bot-descarga/") == "https://pys1.builker.xyz/bot-descarga" ) assert normalize_api_url("http://127.0.0.1:8189") == "http://127.0.0.1:8189/bot-descarga"