feat(tradein/avito): ротация exit-IP по счётчику попыток в доборе карточек #3302

Merged
lekss361 merged 2 commits from feat/avito-rotate-by-attempt-counter into main 2026-08-31 12:09:04 +00:00
Showing only changes of commit 8cf31aba04 - Show all commits

View file

@ -67,6 +67,12 @@ def _fake_settings(**overrides: object) -> MagicMock:
"detail_backfill_block_ratio_window": 20, "detail_backfill_block_ratio_window": 20,
"detail_backfill_block_ratio_threshold": 0.7, "detail_backfill_block_ratio_threshold": 0.7,
"browser_http_endpoint": "http://browser:9000", "browser_http_endpoint": "http://browser:9000",
# Реальный дефолт (config.py). Без него bare MagicMock отдаёт
# child-MagicMock на сравнение `attempts_since_rotation >= settings.avito_
# detail_backfill_rotate_after_attempts` в browser-режиме, и тест падает
# TypeError: '>=' not supported between 'int' and 'MagicMock'. Та же
# ловушка, что уже описана здесь для detail_backfill_block_ratio_window.
"avito_detail_backfill_rotate_after_attempts": 15,
} }
defaults.update(overrides) defaults.update(overrides)
return MagicMock(**defaults) return MagicMock(**defaults)