Commit b2e9636
fix(tests): switch HMAC rejection tests from GET to POST endpoint
The four rejection tests in tests/integration/test_hmac.py
(test_hmac_no_key_rejected, test_hmac_wrong_key_rejected, and their
async variants) were calling client.get_enums(), which is a GET
request. The Comlink HMAC service does not protect GET endpoints,
so the server returned 200 OK regardless of authentication and the
expected SwgohComlinkException was never raised, causing all four
tests to fail with "DID NOT RAISE".
Switch to client.get_player_arena(allycode=TEST_ALLYCODE,
player_details_only=True), which is a POST request to /playerArena
(an HMAC-protected endpoint). Use the shared TEST_ALLYCODE constant
from conftest so the rejection tests align with the existing
get_player and get_player_arena success tests.
Verified end-to-end against a live HMAC-protected Comlink container:
all four tests now correctly observe HTTP 403 HMACValidationError
responses and pass; a positive control with valid keys returns a
real playerDetailsOnly response.
Fixes #88
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent c9e3f59 commit b2e9636
1 file changed
Lines changed: 29 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
51 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
52 | 58 | | |
53 | | - | |
| 59 | + | |
54 | 60 | | |
55 | 61 | | |
56 | 62 | | |
57 | 63 | | |
58 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
59 | 70 | | |
60 | 71 | | |
61 | 72 | | |
| |||
64 | 75 | | |
65 | 76 | | |
66 | 77 | | |
67 | | - | |
| 78 | + | |
68 | 79 | | |
69 | 80 | | |
70 | 81 | | |
| |||
94 | 105 | | |
95 | 106 | | |
96 | 107 | | |
97 | | - | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
98 | 114 | | |
99 | 115 | | |
100 | | - | |
| 116 | + | |
101 | 117 | | |
102 | 118 | | |
103 | 119 | | |
104 | 120 | | |
105 | 121 | | |
106 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
107 | 128 | | |
108 | 129 | | |
109 | 130 | | |
110 | 131 | | |
111 | 132 | | |
112 | 133 | | |
113 | | - | |
| 134 | + | |
114 | 135 | | |
115 | 136 | | |
116 | 137 | | |
| |||
0 commit comments