Should return best strategy for error type.
(self)
| 204 | assert stats["total_attempts"] >= 1 |
| 205 | |
| 206 | def test_get_best_strategy(self): |
| 207 | """Should return best strategy for error type.""" |
| 208 | tracker = StrategyTracker() |
| 209 | # Record multiple successful attempts |
| 210 | for _ in range(5): |
| 211 | tracker.record_attempt("use_patch", "write_failed", success=True, duration=1.0) |
| 212 | for _ in range(3): |
| 213 | tracker.record_attempt("retry", "write_failed", success=False, duration=2.0) |
| 214 | |
| 215 | best = tracker.get_best_strategy("write_failed") |
| 216 | assert best == "use_patch" |
| 217 | |
| 218 | def test_get_strategies_for_error(self): |
| 219 | """Should return ranked strategies.""" |
nothing calls this directly
no test coverage detected