Commit 190a35c
test(billing): cover Wave 4b test-mode key-swap + fail-closed branches (100% patch)
The 100%-patch diff-cover gate flagged two uncovered branches:
- billing.go:305-307 — the rzp_test_* key-swap inside the PRODUCTION default
CreateSubscription closure (tests override the field, so the default body
with the flag-true branch never ran). Added ExerciseCreateSubscriptionTestMode
which invokes the default closure WITH subBodyTestModeKey set.
- billing.go:597-602 — resolveCheckoutTestMode fail-CLOSED branch on an
is_test_cohort DB error. Added TestResolveCheckoutTestMode_FailsClosedOnDBError
(closed *sql.DB → IsTestCohort errors → useTest=false).
Both confirmed covered via go tool cover on the previously-missing line ranges.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 951d5c2 commit 190a35c
2 files changed
Lines changed: 45 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
105 | 132 | | |
106 | 133 | | |
107 | 134 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
60 | 78 | | |
61 | 79 | | |
62 | 80 | | |
| |||
0 commit comments