Skip to content

Commit 26c5bdc

Browse files
AISDK-221 Fix HIPAA Error Message on Incorrect Usage (#95)
1 parent 6e0f414 commit 26c5bdc

File tree

2 files changed

+6
-14
lines changed

2 files changed

+6
-14
lines changed

tests/helpers/errors.py

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,23 @@ def get_error_test_cases(errors):
44

55
ERRORS = {
66
'invalid-parameters': {
7-
"parameter": {
8-
"example": [
9-
"The example field is required"
10-
]
11-
},
127
"type": "https://www.rev.ai/api/v1/errors/invalid-parameters",
13-
"title": "Your request parameters didn't validate",
8+
"title": "Your request parameters did not validate",
149
"status": 400
1510
},
1611
'unauthorized': {
1712
"title": "Authorization has been denied for this request",
1813
"status": 401
1914
},
15+
'forbidden': {
16+
"status": 403,
17+
"error": "The client is forbidden to submit that request"
18+
},
2019
'job-not-found': {
2120
"type": "https://www.rev.ai/api/v1/errors/job-not-found",
2221
"title": "could not find job",
2322
"status": 404
2423
},
25-
'out-of-credit': {
26-
"title": "You do not have enough credits",
27-
"type": "https://www.rev.ai/api/v1/errors/out-of-credit",
28-
"detail": "You have only 60 seconds remaining",
29-
"current_balance": 60,
30-
"status": 403
31-
},
3224
'invalid-job-state': {
3325
"allowed_values": [
3426
"transcribed"

tests/test_baseclient.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def test_constructor_with_no_token(self, token):
2929
RevAiAPIClient(token)
3030

3131
@pytest.mark.parametrize('error', get_error_test_cases(
32-
['unauthorized', 'job-not-found', 'invalid-job-state']))
32+
['invalid-parameters', 'unauthorized', 'forbidden', 'job-not-found', 'invalid-job-state']))
3333
@pytest.mark.parametrize('method', ["POST", "GET", "DELETE"])
3434
def test_make_http_request(self, error, method, mock_session,
3535
make_mock_response):

0 commit comments

Comments
 (0)