Skip to content

Commit d7fc6fc

Browse files
authored
fix: test retry with 502 status code instead of 500 (#152)
## Description Status code 500 doesn't retry now, so changed status code from `500` to `502` in `test_unit_retry_with_backoff_does_retry`
1 parent 5f09f06 commit d7fc6fc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: _test_unstructured_client/unit/test_custom_hooks.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ def test_unit_retry_with_backoff_does_retry(caplog):
2424
)
2525

2626
with requests_mock.Mocker() as mock:
27-
# mock a 500 status code for POST requests to the api
28-
mock.post("https://api.unstructuredapp.io/general/v0/general", status_code=500)
27+
# mock a 502 status code for POST requests to the api
28+
mock.post("https://api.unstructuredapp.io/general/v0/general", status_code=502)
2929
session = UnstructuredClient(api_key_auth=FAKE_KEY)
3030

3131
with open(filename, "rb") as f:
@@ -35,7 +35,7 @@ def test_unit_retry_with_backoff_does_retry(caplog):
3535

3636
with pytest.raises(Exception) as excinfo:
3737
resp = session.general.partition(req, retries=retries)
38-
assert resp.status_code == 500
38+
assert resp.status_code == 502
3939
assert "API error occurred" in str(excinfo.value)
4040

4141
# the number of retries varies

0 commit comments

Comments
 (0)