Commit 4c5c80e
committed
test: harden plan-still-loads-state guards
The previous assertion `call.kwargs.get("load_state", True)` silently
passes if the `load_state=load_state` line is removed from cli/main.py
entirely - the kwarg becomes absent, defaults to True, assertion
holds. Combined with the earlier point that `mock.called` alone is too
loose (because `context.plan(...)` touches state regardless of
load_state), the right guard checks three complementary things:
- "load_state" is in call.kwargs (catches kwarg deletion)
- the value is True (catches `plan` being added to the tuple)
- the patched get_versions was actually called (catches `plan`
being added to the tuple from the other direction)
Both regression modes verified to fail loudly with the new asserts.
Coding-Agent: pi
Model: anthropic/claude-opus-4-7
Signed-off-by: Joe Hartshorn <8881940+j-hartshorn@users.noreply.github.com>1 parent 95d2f9d commit 4c5c80e
1 file changed
Lines changed: 21 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2272 | 2272 | | |
2273 | 2273 | | |
2274 | 2274 | | |
2275 | | - | |
2276 | | - | |
| 2275 | + | |
| 2276 | + | |
| 2277 | + | |
| 2278 | + | |
| 2279 | + | |
| 2280 | + | |
| 2281 | + | |
| 2282 | + | |
| 2283 | + | |
| 2284 | + | |
| 2285 | + | |
2277 | 2286 | | |
2278 | 2287 | | |
2279 | 2288 | | |
2280 | | - | |
2281 | | - | |
| 2289 | + | |
2282 | 2290 | | |
2283 | | - | |
| 2291 | + | |
2284 | 2292 | | |
2285 | 2293 | | |
2286 | 2294 | | |
2287 | 2295 | | |
2288 | 2296 | | |
2289 | | - | |
2290 | | - | |
2291 | | - | |
2292 | | - | |
| 2297 | + | |
| 2298 | + | |
| 2299 | + | |
| 2300 | + | |
| 2301 | + | |
| 2302 | + | |
| 2303 | + | |
| 2304 | + | |
2293 | 2305 | | |
2294 | 2306 | | |
2295 | 2307 | | |
| |||
0 commit comments