File tree Expand file tree Collapse file tree 3 files changed +5
-2
lines changed Expand file tree Collapse file tree 3 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 15
15
import pytest
16
16
17
17
import nucleus
18
+ from nucleus .constants import SUCCESS_STATUS_CODES
18
19
19
20
20
21
assert 'NUCLEUS_PYTEST_API_KEY' in os .environ , \
@@ -47,7 +48,7 @@ def _make_request_patch(
47
48
payload : dict , route : str , requests_command = requests .post
48
49
) -> dict :
49
50
response = client ._make_request_raw (payload , route , requests_command )
50
- assert response .status_code in [ 200 , 201 ] , \
51
+ assert response .status_code in SUCCESS_STATUS_CODES , \
51
52
f"HTTP response had status code: { response .status_code } . " \
52
53
f"Full JSON: { response .json ()} "
53
54
return response .json ()
Original file line number Diff line number Diff line change 96
96
ANNOTATIONS_PROCESSED_KEY ,
97
97
PREDICTIONS_PROCESSED_KEY ,
98
98
STATUS_CODE_KEY ,
99
+ SUCCESS_STATUS_CODES ,
99
100
DATASET_NAME_KEY ,
100
101
DATASET_MODEL_RUNS_KEY ,
101
102
DATASET_SLICES_KEY ,
@@ -917,7 +918,7 @@ def _make_request(
917
918
"""
918
919
response = self ._make_request_raw (payload , route , requests_command )
919
920
920
- if response .status_code not in [ 200 , 201 ] :
921
+ if response .status_code not in SUCCESS_STATUS_CODES :
921
922
logger .warning (response )
922
923
923
924
return (
Original file line number Diff line number Diff line change 16
16
ANNOTATIONS_PROCESSED_KEY = "annotations_processed"
17
17
PREDICTIONS_PROCESSED_KEY = "predictions_processed"
18
18
STATUS_CODE_KEY = "status_code"
19
+ SUCCESS_STATUS_CODES = [200 , 201 ]
19
20
ERRORS_KEY = "errors"
20
21
MODEL_RUN_ID_KEY = "model_run_id"
21
22
MODEL_ID_KEY = "model_id"
You can’t perform that action at this time.
0 commit comments