Commit e430896
test: Checkout gate-hook + capture_wallet + zero-settle paths reach 95% coverage
Adds tests covering the previously-uncovered Checkout flows:
- gate run_gate escape hatch (allow / deny / invalid-shape branches)
- gate per_request_policy returning None (skip-gate path)
- gate on_denied callback reshaping the canonical denial body
- gate happy path attaches ctx.capture_wallet closure; the closure itself
is exercised end-to-end with AgentScoreCore.acapture_wallet mocked
- Checkout.accepted_rails dedupes tempo + tempo_session to a single slug
- Checkout.accepted_method_names emits each protocol method
- zero-settle MPP carve-out at zero (compose_mppx skipped, signer lifted)
Also tightens the _spec_rail_key / _spec_method_name return types from
RailKey | None / str | None to non-nullable (every code path returns a
value; the | None was dead and the key is None checks in the
accepted_rails / accepted_method_names accessors were unreachable).
Mirrors the same fix landed in node-commerce.
Tests: 1156 passed, 4 skipped. Total coverage: 93.02 to 95.00 percent.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 79a8b84 commit e430896
2 files changed
Lines changed: 417 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
| 107 | + | |
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
| 111 | + | |
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
120 | | - | |
121 | | - | |
| 119 | + | |
122 | 120 | | |
123 | 121 | | |
124 | | - | |
| 122 | + | |
125 | 123 | | |
126 | 124 | | |
127 | 125 | | |
128 | 126 | | |
129 | 127 | | |
130 | 128 | | |
131 | 129 | | |
132 | | - | |
133 | | - | |
134 | | - | |
| 130 | + | |
135 | 131 | | |
136 | 132 | | |
137 | 133 | | |
| |||
618 | 614 | | |
619 | 615 | | |
620 | 616 | | |
621 | | - | |
| 617 | + | |
622 | 618 | | |
623 | 619 | | |
624 | 620 | | |
| |||
635 | 631 | | |
636 | 632 | | |
637 | 633 | | |
638 | | - | |
| 634 | + | |
639 | 635 | | |
640 | 636 | | |
641 | 637 | | |
| |||
0 commit comments