Should suggest fix from error database.
(self)
| 274 | assert best == "use_patch" |
| 275 | |
| 276 | def test_suggest_fix(self): |
| 277 | """Should suggest fix from error database.""" |
| 278 | lm = LearningManager() |
| 279 | lm.learn_from_error_and_fix( |
| 280 | "ValueError", |
| 281 | "invalid literal for int", |
| 282 | "add try/except", |
| 283 | success=True |
| 284 | ) |
| 285 | |
| 286 | suggestion = lm.suggest_fix("ValueError", "invalid literal for int") |
| 287 | assert suggestion == "add try/except" |
| 288 | |
| 289 | def test_get_preference(self): |
| 290 | """Should get learned preference.""" |
nothing calls this directly
no test coverage detected