Commit 537eb47
refactor(cli): guard device resolution, fix test catalog isolation
Wrap _resolve_device_handle() in do_login and do_logout with a
(ValueError, KeyError) guard so unknown or missing devices produce a
clean error message + sys.exit(1) instead of an uncaught traceback.
Refactor all four TestCliLoginLogout tests to use the existing
_patch_catalog(stack) helper, which patches entry_points AND registers
a teardown callback that clears _cat._cache, eliminating the catalog
state leak that the previous inline pattern left behind.
Also strengthen test_login_dispatches_to_auth_login to assert that the
real device handle (schema.name == "d3d") is passed to auth.login.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 44f1d4c commit 537eb47
2 files changed
Lines changed: 15 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | 55 | | |
| 56 | + | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
58 | 61 | | |
59 | 62 | | |
60 | 63 | | |
| |||
71 | 74 | | |
72 | 75 | | |
73 | 76 | | |
74 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
75 | 82 | | |
76 | 83 | | |
77 | 84 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
333 | 333 | | |
334 | 334 | | |
335 | 335 | | |
336 | | - | |
337 | 336 | | |
338 | 337 | | |
| 338 | + | |
339 | 339 | | |
340 | 340 | | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | 341 | | |
346 | 342 | | |
347 | 343 | | |
348 | 344 | | |
349 | 345 | | |
350 | 346 | | |
| 347 | + | |
| 348 | + | |
351 | 349 | | |
352 | 350 | | |
353 | 351 | | |
354 | 352 | | |
355 | | - | |
356 | 353 | | |
357 | 354 | | |
| 355 | + | |
358 | 356 | | |
359 | 357 | | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | 358 | | |
365 | 359 | | |
366 | 360 | | |
| |||
369 | 363 | | |
370 | 364 | | |
371 | 365 | | |
372 | | - | |
373 | 366 | | |
| 367 | + | |
374 | 368 | | |
375 | 369 | | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | 370 | | |
381 | 371 | | |
382 | 372 | | |
| |||
385 | 375 | | |
386 | 376 | | |
387 | 377 | | |
388 | | - | |
389 | 378 | | |
| 379 | + | |
390 | 380 | | |
391 | 381 | | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | 382 | | |
397 | 383 | | |
398 | 384 | | |
| |||
0 commit comments