MCPcopy Create free account
hub / github.com/Ishabdullah/Codey-v2 / test_get_best_strategy

Method test_get_best_strategy

tests/test_learning.py:206–216  ·  view source on GitHub ↗

Should return best strategy for error type.

(self)

Source from the content-addressed store, hash-verified

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."""

Callers

nothing calls this directly

Calls 3

record_attemptMethod · 0.95
get_best_strategyMethod · 0.95
StrategyTrackerClass · 0.90

Tested by

no test coverage detected