Commit 53257ca
committed
test: JSON-RPC-specific dispatcher tests + coverage to 100%
Covers behaviors with no DirectDispatcher analog: out-of-order response
correlation, INTERNAL_ERROR over the wire, peer-cancel in interrupt and signal
modes, CONNECTION_CLOSED on stream EOF mid-await, late-response drop,
raise_handler_exceptions propagation, ServerMessageMetadata tagging on
ctx.send_request, null-id JSONRPCError drop, ValidationError->INVALID_PARAMS,
contextvar propagation via _spawn, and the defensive Broken/Closed/WouldBlock
catches.
Two small src tweaks for coverage:
- _cancel_outbound: combine the two except arms into one tuple
- _dispatch: pragma no-branch on the final case (match is exhaustive over
JSONRPCMessage; the no-match arc is unreachable)
43 tests, 100% coverage on all PR2 modules, 0.15s wall-clock.1 parent 200a607 commit 53257ca
2 files changed
Lines changed: 535 additions & 4 deletions
File tree
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
359 | 359 | | |
360 | 360 | | |
361 | 361 | | |
362 | | - | |
| 362 | + | |
363 | 363 | | |
| 364 | + | |
| 365 | + | |
364 | 366 | | |
365 | 367 | | |
366 | 368 | | |
| |||
537 | 539 | | |
538 | 540 | | |
539 | 541 | | |
540 | | - | |
541 | | - | |
542 | | - | |
| 542 | + | |
543 | 543 | | |
0 commit comments