Merge pull request 'test(etl): fix stale assert in objective_backfill dry_run test (#1709 systemic CI red)' (#1721) from fix/objective-backfill-test-1709 into main
Some checks are pending
Deploy / build-backend (push) Blocked by required conditions
Deploy / build-worker (push) Blocked by required conditions
Deploy / build-frontend (push) Blocked by required conditions
Deploy / deploy (push) Blocked by required conditions
Deploy / changes (push) Successful in 7s
Some checks are pending
Deploy / build-backend (push) Blocked by required conditions
Deploy / build-worker (push) Blocked by required conditions
Deploy / build-frontend (push) Blocked by required conditions
Deploy / deploy (push) Blocked by required conditions
Deploy / changes (push) Successful in 7s
Reviewed-on: #1721
This commit is contained in:
commit
f6b3aad03d
1 changed files with 8 additions and 2 deletions
|
|
@ -77,7 +77,12 @@ def test_find_match_candidates_returns_candidates() -> None:
|
|||
|
||||
|
||||
def test_auto_apply_matches_dry_run_no_inserts() -> None:
|
||||
"""dry_run=True возвращает счётчики без обращения к БД (execute не вызывается)."""
|
||||
"""dry_run=True возвращает projected-счётчики без обращения к БД.
|
||||
|
||||
auto_accepted = сколько кандидатов БЫЛО БЫ принято (preview), а не 0 —
|
||||
смысл dry-run в admin-endpoint'е именно показать оператору объём перед
|
||||
реальным insert. execute/commit при этом не вызываются.
|
||||
"""
|
||||
mock_db = MagicMock()
|
||||
|
||||
candidates = [
|
||||
|
|
@ -88,8 +93,9 @@ def test_auto_apply_matches_dry_run_no_inserts() -> None:
|
|||
|
||||
result = auto_apply_matches(mock_db, candidates, dry_run=True)
|
||||
|
||||
assert result["auto_accepted"] == 0
|
||||
assert result["auto_accepted"] == 1 # projected: 1 кандидат >= AUTO_ACCEPT_THRESHOLD
|
||||
assert result["review_queue"] == 2
|
||||
assert result["skipped"] == 0
|
||||
mock_db.execute.assert_not_called()
|
||||
mock_db.commit.assert_not_called()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue