Skip to content

Commit a0cae79

Browse files
TexasCodingclaude
andcommitted
test(integration): swap bad-auth probe from markets.list to portfolio.balance
markets.list() no longer exercises the auth path — Kalshi began serving public market data unauthenticated, so a client with bad credentials gets a 200 back instead of 401/403 and the test "DID NOT RAISE". Switched to portfolio.balance(), which is account-scoped and always auth-required. Added a docstring note so future maintainers know why the endpoint choice matters. Closes 1 of 11 integration-test failures (#124). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent dafa1fb commit a0cae79

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

tests/integration/test_errors.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ def test_bad_auth_returns_auth_error(self) -> None:
5454
5555
Uses a throwaway client with a valid RSA key but wrong key_id,
5656
so signing succeeds but the server rejects the credentials.
57+
58+
Targets ``portfolio.balance()`` because it is account-scoped and
59+
always auth-required. ``markets.list()`` was previously used but
60+
Kalshi began serving public market data unauthenticated, so it
61+
no longer exercises the auth path.
5762
"""
5863
dummy_key = rsa.generate_private_key(
5964
public_exponent=65537, key_size=2048
@@ -68,7 +73,7 @@ def test_bad_auth_returns_auth_error(self) -> None:
6873

6974
try:
7075
with pytest.raises(KalshiAuthError) as exc_info:
71-
client.markets.list(limit=1)
76+
client.portfolio.balance()
7277

7378
exc = exc_info.value
7479
assert exc.status_code in (401, 403)

0 commit comments

Comments
 (0)