gendesign/tradein-mvp/backend/tests
bot-backend 50a72f030a fix(tradein): Mera-audit fix-1 — Cian valuation price sanity bounds
Добавляет _is_price_sane() в cian_valuation.py: если sale_price_rub вне
[cian_valuation_min_rub, cian_valuation_max_rub] (дефолты 500k/500M),
или low_price > high_price, или любой bound отрицательный — результат
не кэшируется и возвращается None (graceful). Защита от garbage-ответов
API (999_999 < min, 9_999_999_999 > max).

Новые settings: cian_valuation_min_rub=500_000, cian_valuation_max_rub=500_000_000.
Тесты: 11 новых тест-кейсов в test_cian_valuation.py. Пофиксен pre-existing
KeyError в test_cache_hit_returns_cached (missing low_price/high_price в mock).
2026-06-21 09:02:32 +03:00
..
fixtures fix(scrapers): avito pipeline — новостройки house graceful (без housePage), AvitoBlockedError per-item не крашит прогон (#1820) 2026-06-20 09:53:46 +03:00
matching fix(matching): conflict_resolution picks freshest (last_seen_at) value, deterministic (#1539) 2026-06-17 22:43:59 +03:00
scrapers fix(scrapers): avito pipeline — новостройки house graceful (без housePage), AvitoBlockedError per-item не крашит прогон (#1820) 2026-06-20 09:53:46 +03:00
scripts fix(backfill): drop nonexistent kadastr_num column from listings SELECT 2026-06-17 23:47:30 +03:00
services test(tradein): patch _geoportal_house_match in cadastral-before-yandex test 2026-06-19 18:06:28 +03:00
tasks feat(tradein): бэкфилл координат листингов из ekb_geoportal_buildings (street+house match) 2026-06-20 17:08:46 +03:00
__init__.py feat(tradein): avito_imv.py — Avito IMV evaluation API client (2 requests) (#444) 2026-05-23 12:16:47 +00:00
test_781_quality_gate.py test(tradein): quality-gate anti-regression тесты на 5 P0-фиксов (#1098) 2026-06-06 19:27:23 +00:00
test_849_matching_savepoint.py fix(matching): Tier 2b alias sync + collapse double SAVEPOINT (#849) (#870) 2026-05-31 08:05:48 +00:00
test_account_quota.py fix(tradein): atomic conditional quota increment — close TOCTOU (#747) (#749) 2026-05-30 15:52:34 +00:00
test_admin_ssrf.py fix(tradein): SSRF host-allowlist на admin scrape + удалён dead ADMIN_TOKEN (Refs #756) (#778) 2026-05-30 16:27:19 +00:00
test_anchor_watchdog.py fix(avito): scale per-anchor timeout for detail-enrich + durable SERP counters (#1661) 2026-06-17 06:07:50 +00:00
test_api_avito_stage4a.py fix(tradein): single-run guard на avito-city-sweep admin-endpoint (#874) 2026-05-31 08:55:33 +00:00
test_asking_to_sold_ratio.py fix(tradein): guard listing_segment во всех читателях listings — novostroyki вне comps (#1186) 2026-06-12 11:52:09 +03:00
test_audit_address_mismatch.py feat(tradein): Phase 1 of #582 — address mismatch audit infrastructure 2026-05-25 12:50:30 +05:00
test_avito_address_clean.py fix(avito): de-glue house number from district marker in _clean_address (#1773) 2026-06-19 13:33:43 +05:00
test_avito_blockpage.py fix(scrapers): avito per-card parse_failures counter + logging (Refs #823) (#830) 2026-05-30 20:01:50 +00:00
test_avito_browser_mode.py feat(scrapers): avito SERP дефолт на BrowserFetcher (camoufox), curl_cffi fallback (#1805) 2026-06-19 20:42:04 +03:00
test_avito_citywide.py feat(tradein): avito citywide + byrooms sweep mode (T6) (#848) 2026-05-31 06:13:19 +00:00
test_avito_detail_parse.py fix(avito): classify novostroyki by item-development-name marker; map переуступка sale_type 2026-06-17 22:24:13 +03:00
test_avito_ekb_geo_filter.py feat(tradein/avito): per-card ЕКБ гео-фильтр (отсечь padding по России) + сплит комнат 4/5+ 2026-06-20 16:59:12 +03:00
test_avito_houses_dedup.py fix(scrapers/backend): socks5 health-probe (httpx[socks]) + status Literal whitelist + #1820 ext_id=0 dedup-гард 2026-06-20 10:17:37 +03:00
test_avito_houses_parse.py fix(scrapers): avito pipeline — новостройки house graceful (без housePage), AvitoBlockedError per-item не крашит прогон (#1820) 2026-06-20 09:53:46 +03:00
test_avito_imv_parse.py fix(tradein-imv): harden Avito IMV anti-bot path + offline contract tests (#565) 2026-05-28 16:29:05 +05:00
test_avito_newbuilding_sweep.py feat(avito): dedicated newbuilding (novostroyka) citywide sweep 2026-06-18 09:45:54 +03:00
test_avito_relative_date.py fix(tradein): Avito listing_date extraction (3 формата) (#601) 2026-05-27 12:55:27 +00:00
test_avito_serp_date.py feat(avito): capture newbuilding ЖК id/url from SERP card; persist newbuilding_id/url 2026-06-17 23:15:35 +03:00
test_backfill_house_coords.py feat(tradein): Phase 2-3 of #582 — Yandex backfill + canonical audit (#591) 2026-05-27 06:30:54 +00:00
test_backfill_wave2.py fix(tradein): починить 3 теста-регрессии из #1543 (sber rollback mock, matching tier0, cian price history) — deploy gate green 2026-06-16 09:03:27 +03:00
test_backtest_estimator.py feat(backtest): per-rooms asking→sold correction block (#648 S1) (#650) 2026-05-29 13:11:55 +00:00
test_ban_rotation_1790.py fix(scrapers): avito ban-triggered IP rotation (#1790) — changeip on block, bounded 2026-06-20 21:24:12 +03:00
test_base_save_listings.py feat(tradein/scrapers): full_load пропускает листинги обновлённые сегодня при повторном прогоне (skip_seen_today) 2026-06-20 12:13:32 +03:00
test_cian_city_sweep.py feat(tradein): schedule cian_full_load (exhaustive secondary) + anchor sweep NB-only 2026-06-18 13:25:23 +03:00
test_cian_detail.py fix(scrapers): cian_detail — ceiling/repair актуальные пути state (#1791) 2026-06-19 19:57:18 +03:00
test_cian_newbuilding.py feat(browser): per-source proxy pool behind FEATURE_BROWSER_POOL_ENABLED (Phase 1) 2026-06-18 09:01:50 +03:00
test_cian_serp_scraper.py feat(scrapers): cian SERP на BrowserFetcher (camoufox), снят code-side rotate (#1806) 2026-06-19 20:41:44 +03:00
test_cian_session.py fix(cian): verify_session на curl_cffi impersonate — ban != cookies expired (Refs #768) (#785) 2026-05-30 16:40:54 +00:00
test_cian_state_parser.py fix(tradein): cian _cianConfig concat-формат + auth из header-frontend (#639) (#819) 2026-05-30 19:08:01 +00:00
test_cian_valuation.py fix(tradein): Mera-audit fix-1 — Cian valuation price sanity bounds 2026-06-21 09:02:32 +03:00
test_city_sweep.py test(tradein): fix sweep-endpoint тесты после single-run guard (#874 follow-up) (#876) 2026-05-31 09:07:41 +00:00
test_config_avito_rotations.py fix(avito): proactive IP rotate at sweep start + raise max_rotations 2->4 (Datadome ban recovery) 2026-06-17 23:35:24 +03:00
test_deactivate_stale_avito.py feat(scrapers): segment-aware generic deactivate_stale for yandex/cian (#1558) 2026-06-16 16:09:19 +00:00
test_deactivate_stale_listings.py feat(scrapers): segment-aware generic deactivate_stale for yandex/cian (#1558) 2026-06-16 16:09:19 +00:00
test_deals_sanitize.py fix(tradein): sanitize ДКП deal outliers (floor / ppm²) (#699) (#733) 2026-05-30 14:31:44 +00:00
test_domclick_sweep.py feat(domclick): wire DomClick citywide sweep into pipeline+scheduler (seeded disabled) 2026-06-17 23:21:49 +03:00
test_ekb_geoportal_ingest.py feat(tradein): EKB geoportal building ingest + geocoder tier (complete city buildings) 2026-06-19 17:51:07 +03:00
test_estimate_idor.py fix(tradein): rehydrate POST-only fields on GET /estimate/{id} (#696) (#710) 2026-05-30 11:05:52 +00:00
test_estimator_audit_fixes.py test(estimator): unit tests для audit fixes #audit-1..5 + empty-series guard 2026-06-20 15:06:59 +03:00
test_estimator_cian_budget.py fix(tradein): budget Cian valuation call to stop 25s estimate stalls 2026-06-19 12:43:28 +03:00
test_estimator_cian_integration.py feat(tradein): estimator additive expected_sold price (#648 S3) (#661) 2026-05-29 13:37:33 +00:00
test_estimator_client_coords.py feat(tradein): estimate accepts client-provided coords, skips geocode (Variant A) 2026-06-19 14:15:02 +03:00
test_estimator_cohort.py fix(tradein-estimator): extend cohort filter to Tier S + Tier H, fix late_soviet overlap (#522) 2026-05-24 13:14:59 +00:00
test_estimator_enrich.py refactor(tradein): unify kadastr_num -> cadastral_number (#732) 2026-05-31 15:41:52 +03:00
test_estimator_expected_sold.py feat(tradein): same-building anchor safe-guard (#755) 2026-05-31 12:19:50 +03:00
test_estimator_expected_sold_clamp.py fix(estimator): clamp expected_sold <= asking (ratio cap 1.0) -- smoke 3к exp_sold>asking 2026-06-21 00:35:23 +03:00
test_estimator_floor_optional.py feat(tradein): этаж/этажность optional + best test presets по deal count (#558) 2026-05-24 21:44:44 +00:00
test_estimator_imv_blend.py fix(estimator): DKP corridor uses P10/P90 not min/max (#1520) 2026-06-17 20:50:15 +03:00
test_estimator_imv_integration.py feat(tradein): integrate Avito IMV as 5th evaluation source (on-demand cached) (#452) 2026-05-23 13:08:22 +00:00
test_estimator_null_floor_timeout.py fix(tradein): time-budget estimate enrichment + observable errors to stop opaque 502 (#654) (#673) 2026-05-29 17:22:02 +00:00
test_estimator_pure_units.py fix(tradein/estimator): clamp premium headline к коридору сделок + робастный anchor (#1795) 2026-06-19 20:34:48 +03:00
test_estimator_quarter_index.py fix(estimator): sanity-clamp quarter-index factor (#859) (#863) 2026-05-31 07:20:59 +00:00
test_estimator_radius_floor.py fix(estimator): radius-path нижний floor от DKP-коридора (анти-undershoot) 2026-06-21 00:25:05 +03:00
test_estimator_ratio_tier_fix.py fix(estimator): asking_to_sold ratio tier по финальному headline 2026-06-21 00:24:02 +03:00
test_estimator_repair_coef.py feat(tradein): estimator additive expected_sold price (#648 S3) (#661) 2026-05-29 13:37:33 +00:00
test_estimator_sber_time_adjust.py test(tradein): fix #794 test regressions on main (broken by #919 early squash-merge) (#921) 2026-05-31 19:05:10 +00:00
test_estimator_source_quota.py feat(tradein): estimator additive expected_sold price (#648 S3) (#661) 2026-05-29 13:37:33 +00:00
test_estimator_yandex_integration.py test(tradein): align yandex history tests с batch-executemany (unblock deploy) (#851) 2026-05-31 06:16:45 +00:00
test_extract_short_addr.py feat(tradein-estimator): tiered house-match S→H→W (#507) 2026-05-24 12:41:12 +00:00
test_geo_precision.py feat(estimator): exclude city-centroid listings from radius analogs (Refs #769 Part E) 2026-05-30 21:22:21 +03:00
test_geocode_reverse_api.py feat(tradein): MapPicker snap marker — Phase 5 of #582 (#594) 2026-05-27 09:30:17 +00:00
test_geocoder_cadastral_matcher.py feat(tradein): EKB geoportal building ingest + geocoder tier (complete city buildings) 2026-06-19 17:51:07 +03:00
test_history_scope.py chore(tradein): close pre-commit ruff gap + add CI pytest gate (#666) (#675) 2026-05-29 19:18:48 +00:00
test_houses_rating_filter_entries_1789.py fix(scrapers): avito ban-triggered IP rotation (#1790) — changeip on block, bounded 2026-06-20 21:24:12 +03:00
test_insufficient_data_flag.py feat(tradein): insufficient_data flag on AggregatedEstimate (#697) (#734) 2026-05-30 14:40:04 +00:00
test_listing_source_snapshot.py feat(tradein): per-source listing price history — schema + daily snapshot (#570) (#646) 2026-05-29 12:18:04 +00:00
test_matching.py fix(tradein): починить 3 теста-регрессии из #1543 (sber rollback mock, matching tier0, cian price history) — deploy gate green 2026-06-16 09:03:27 +03:00
test_me_brand.py fix(tradein): remove «Практика» white-label brand (DB row + account mapping + assets) 2026-06-19 12:53:37 +03:00
test_pdf_security.py fix(pdf): brand-spoof + median=0 empty-state + SSRF + дисклеймер + sources (Refs #772) (#789) 2026-05-30 16:55:56 +00:00
test_pipeline_browser_routing.py feat(tradein): route avito pipeline SERP+detail+houses through BrowserFetcher (#915) (#916) 2026-05-31 18:10:38 +00:00
test_ratelimit.py fix(tradein): bypass rate-limit for authenticated pilots + configurable limit (#655) (#669) 2026-05-29 15:56:30 +00:00
test_rbac.py feat(rbac): pilot scope → только /trade-in/** (#587) 2026-05-26 07:40:44 +00:00
test_repair_state_normalizer.py fix(scrapers): cian_detail — ceiling/repair актуальные пути state (#1791) 2026-06-19 19:57:18 +03:00
test_rosreestr_dedup_key.py fix(tradein): plain natural-key dedup_hash for rosreestr deals (#576) (#638) 2026-05-29 06:56:35 +00:00
test_rosreestr_poll.py feat(tradein): scheduled monthly Rosreestr new-quarter poll → ingest alert (#888) (#894) 2026-05-31 13:13:55 +00:00
test_sales_vs_listings.py feat(tradein): sales-vs-listings endpoint (PR K, foundation #564) (#597) 2026-05-27 11:55:44 +00:00
test_same_building_anchor.py feat(tradein): same-building anchor safe-guard (#755) 2026-05-31 12:19:50 +03:00
test_same_building_match.py feat(tradein): same-building матчинг аналогов по house_id (#6) 2026-05-28 13:55:51 +05:00
test_sber_index.py fix(tradein): correct SberIndex hedonic/asking dataset-paths + 404 warning (#902) 2026-06-17 22:50:52 +03:00
test_scheduler.py feat(scheduler): per-source interval_days cadence (weekly exhaustive avito) 2026-06-18 23:10:18 +03:00
test_scheduler_main.py test(tradein): убрать мёртвый monkeypatch в test_scheduler_main (review fixup) 2026-06-12 10:56:27 +03:00
test_scrape_pipeline.py fix(scrapers): avito pipeline — новостройки house graceful (без housePage), AvitoBlockedError per-item не крашит прогон (#1820) 2026-06-20 09:53:46 +03:00
test_scrape_run_alert.py feat(observability): sentry alert on N consecutive scraper failures (Refs #827) (#833) 2026-05-30 20:10:29 +00:00
test_scraper_admin_apis.py feat(scrapers): live pacing-регулятор (GET/PUT /scraper/pacing) + data-quality coverage endpoint 2026-06-20 12:47:03 +03:00
test_scraper_proxy.py feat(browser): per-source proxy pool behind FEATURE_BROWSER_POOL_ENABLED (Phase 1) 2026-06-18 09:01:50 +03:00
test_scraper_settings.py chore(tradein): деактивировать N1.ru scraper — источник переехал в Cian 2026-06-16 14:50:51 +03:00
test_search_api.py feat(tradein): segment=vtorichka|novostroyki|all query-param on listings (#1188) 2026-06-17 21:43:01 +03:00
test_segment_guard_1186.py fix(estimator): #1774 Tier A admits same-building novostroyki resales when secondary-dominant 2026-06-19 14:00:13 +05:00
test_sentry_scrub.py feat(tradein): enrich GlitchTip SDK init — integrations + PII scrub (#396) (#643) 2026-05-29 09:23:17 +00:00
test_snapshot_writer.py fix(tradein): implement listings_snapshots + offer_price_history writers (#567) (#624) 2026-05-28 13:49:52 +00:00
test_street_deals_endpoint.py fix(tradein): word-boundary street match + cian unescape robustness (Refs #769 A1+D) (#798) 2026-05-30 17:18:33 +00:00
test_sweep_imv_phase.py fix(avito): scale per-anchor timeout for detail-enrich + durable SERP counters (#1661) 2026-06-17 06:07:50 +00:00
test_tier_a_primary_1774.py fix(estimator): #1774 Tier A admits same-building novostroyki resales when secondary-dominant 2026-06-19 14:00:13 +05:00
test_yandex_city_sweep.py fix(tradein/yandex): инкрементальный per-combo save + bounded gate-timeout (анти-зомби city_sweep) 2026-06-20 20:57:41 +03:00
test_yandex_detail.py refactor(tradein): drop dead schema — sale_type_text column + audit_log (#731) (#893) 2026-05-31 13:13:43 +00:00
test_yandex_detail_structural.py fix(scrapers): yandex_detail — area/ceiling из структурного блока, покрытие area 63%->~95% (#1792) 2026-06-19 19:37:51 +03:00
test_yandex_helpers.py fix(tradein): Yandex listing_date — keyword + absolute-no-year (#602) 2026-05-27 13:11:22 +00:00
test_yandex_history_area_filter.py fix(scrapers): yandex history skip area<=0 items 2026-06-21 00:25:43 +03:00
test_yandex_newbuilding.py fix(tradein): yandex newbuilding rating drift — "4.3из 5" без пробела (#974) 2026-06-15 21:29:43 +03:00
test_yandex_price_history.py feat(tradein): populate offer_price_history for yandex from gate price.previous/trend 2026-06-18 14:23:23 +03:00
test_yandex_realty_serp.py fix(tradein/yandex): инкрементальный per-combo save + bounded gate-timeout (анти-зомби city_sweep) 2026-06-20 20:57:41 +03:00
test_yandex_scrapers_delay_wiring.py feat(tradein): scraper_settings live-config + Yandex admin trigger endpoints (#484) 2026-05-23 15:28:34 +00:00
test_yandex_valuation.py fix(yandex-valuation): off-by-one cell index in _parse_row_cells (#552) 2026-05-24 19:57:17 +00:00
test_yandex_valuation_save.py perf(estimator): executemany batch insert in _save_yandex_history_items (Refs #826) (#832) 2026-05-30 20:07:06 +00:00