Commit bb6cfa9
committed
Add tests for MCPServer.read_resource exception handling
Cover the two exception paths in read_resource that were previously
excluded from coverage: unknown resource errors and resource read
failures. The tests verify that both cases properly raise MCPError
with appropriate messages.
Also improve exception chaining by using 'from exc' syntax and
simplify the error message format.1 parent 1e3e62f commit bb6cfa9
File tree
3 files changed
+155
-245
lines changed- src/mcp/server
- lowlevel
- mcpserver
- tests/server/mcpserver
3 files changed
+155
-245
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
795 | 795 | | |
796 | 796 | | |
797 | 797 | | |
798 | | - | |
799 | | - | |
800 | | - | |
801 | | - | |
802 | | - | |
803 | | - | |
| 798 | + | |
804 | 799 | | |
805 | 800 | | |
806 | 801 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
348 | 348 | | |
349 | 349 | | |
350 | 350 | | |
351 | | - | |
| 351 | + | |
352 | 352 | | |
353 | 353 | | |
354 | 354 | | |
355 | 355 | | |
356 | 356 | | |
357 | | - | |
358 | | - | |
359 | | - | |
| 357 | + | |
| 358 | + | |
360 | 359 | | |
361 | 360 | | |
362 | 361 | | |
| |||
0 commit comments