sources: панели не схлопываются с rad_ того же домена (175 вместо 5 в реестре); тесты уникальности по (url, adapter)
Some checks failed
ci / test (3.10) (push) Has been cancelled
ci / test (3.11) (push) Has been cancelled
ci / test (3.12) (push) Has been cancelled

This commit is contained in:
Vlad Gothbreach
2026-10-27 04:09:59 +03:00
parent 1781983027
commit 0831984918
4 changed files with 11 additions and 5 deletions

View File

@@ -122,8 +122,10 @@ def test_bot_not_claimable_by_first_writer(monkeypatch):
# ---------- 6. реестр без дублей ----------
def test_sources_unique():
from omni import sources
urls = [s.url.rstrip("/").lower() for s in sources.all_sources() if s.url]
assert len(urls) == len(set(urls)), "в реестре дубли по url"
# Панель (newapi_pricing) и обход сайта (html_listing) на одном домене — разные источники,
# поэтому уникальность проверяем по паре (url, adapter), а не по голому url.
keys = [(s.url.rstrip("/").lower(), s.adapter) for s in sources.all_sources() if s.url]
assert len(keys) == len(set(keys)), "в реестре дубли по (url, adapter)"
# ---------- 7. JOBS не растёт бесконечно ----------