Skip to content

Commit 0204dce

Browse files
Test non-standard response
1 parent d2c5bf1 commit 0204dce

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/http_error_test.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import pytest
2+
import niquests
23
from seam import Seam
34
from seam.exceptions import (
45
SeamHttpApiError,
@@ -44,3 +45,18 @@ def test_seam_http_throws_invalid_input_error(server):
4445
assert err.status_code == 400
4546
assert err.code == "invalid_input"
4647
assert err.request_id.startswith("request")
48+
49+
50+
def test_seam_http_throws_http_error_on_non_standard_response(server):
51+
endpoint, seed = server
52+
seam = Seam.from_api_key(seed["seam_apikey1_token"], endpoint=endpoint)
53+
54+
seam.client.post(
55+
"/_fake/simulate_workspace_outage",
56+
json={"workspace_id": seed["seed_workspace_1"], "routes": ["/devices/list"]},
57+
)
58+
59+
with pytest.raises(niquests.HTTPError) as exc_info:
60+
seam.devices.list()
61+
62+
assert exc_info.value.response.status_code == 503

0 commit comments

Comments
 (0)