test: красные проверки запасного пути справочных вопросов, пробы остатка дипсика и телеграма через впн

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
anor
2026-09-24 02:06:34 +10:00
co-authored by Claude Opus 5.5
parent e8e571d037
commit f7b1aebe07
7 changed files with 605 additions and 7 deletions
+6 -6
View File
@@ -164,9 +164,9 @@ def test_ping_goes_to_the_right_provider(mods, monkeypatch):
async def fake_probe(url, *a, **kw):
seen["url"] = url
return True
return True, "ок"
monkeypatch.setattr(ph, "_http_ok", fake_probe, raising=False)
monkeypatch.setattr(ph, "_http_probe", fake_probe, raising=False)
import asyncio
asyncio.run(ph.ping_provider("glm"))
assert "z.ai" in seen.get("url", ""), f"пинг зайки ушёл не туда: {seen}"
@@ -194,9 +194,9 @@ def test_ping_finds_the_key_where_it_actually_lives(mods, monkeypatch, tmp_path)
async def fake_http(url, key, **kw):
seen["key"] = key
return True
return True, "ок"
monkeypatch.setattr(ph, "_http_ok", fake_http)
monkeypatch.setattr(ph, "_http_probe", fake_http)
assert asyncio.run(ph.ping_provider("glm")) is True
assert seen.get("key") == "kluch-iz-faila", f"ключ не найден: {seen}"
@@ -237,9 +237,9 @@ def test_unknown_provider_is_not_pinged_as_deepseek(mods, monkeypatch):
async def fake_http(url, key, **kw):
seen["url"] = url
return True
return True, "ок"
monkeypatch.setattr(ph, "_http_ok", fake_http)
monkeypatch.setattr(ph, "_http_probe", fake_http)
assert asyncio.run(ph.ping_provider("neizvestnyi")) is False
assert "url" not in seen, f"постучались куда-то: {seen}"