Compare commits
No commits in common. "f6b3aad03d9e0acf67d90de0174c3f2c1d35849d" and "5b8ee994d5913f30781854d92babf0c4ff2cd87f" have entirely different histories.
f6b3aad03d
...
5b8ee994d5
1 changed files with 2 additions and 8 deletions
|
|
@ -77,12 +77,7 @@ def test_find_match_candidates_returns_candidates() -> None:
|
||||||
|
|
||||||
|
|
||||||
def test_auto_apply_matches_dry_run_no_inserts() -> None:
|
def test_auto_apply_matches_dry_run_no_inserts() -> None:
|
||||||
"""dry_run=True возвращает projected-счётчики без обращения к БД.
|
"""dry_run=True возвращает счётчики без обращения к БД (execute не вызывается)."""
|
||||||
|
|
||||||
auto_accepted = сколько кандидатов БЫЛО БЫ принято (preview), а не 0 —
|
|
||||||
смысл dry-run в admin-endpoint'е именно показать оператору объём перед
|
|
||||||
реальным insert. execute/commit при этом не вызываются.
|
|
||||||
"""
|
|
||||||
mock_db = MagicMock()
|
mock_db = MagicMock()
|
||||||
|
|
||||||
candidates = [
|
candidates = [
|
||||||
|
|
@ -93,9 +88,8 @@ def test_auto_apply_matches_dry_run_no_inserts() -> None:
|
||||||
|
|
||||||
result = auto_apply_matches(mock_db, candidates, dry_run=True)
|
result = auto_apply_matches(mock_db, candidates, dry_run=True)
|
||||||
|
|
||||||
assert result["auto_accepted"] == 1 # projected: 1 кандидат >= AUTO_ACCEPT_THRESHOLD
|
assert result["auto_accepted"] == 0
|
||||||
assert result["review_queue"] == 2
|
assert result["review_queue"] == 2
|
||||||
assert result["skipped"] == 0
|
|
||||||
mock_db.execute.assert_not_called()
|
mock_db.execute.assert_not_called()
|
||||||
mock_db.commit.assert_not_called()
|
mock_db.commit.assert_not_called()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue