Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
mgyucht committed Aug 30, 2024
1 parent dc4f9e3 commit cdff06d
Showing 1 changed file with 28 additions and 20 deletions.
48 changes: 28 additions & 20 deletions tests/test_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,26 +43,34 @@ def make_private_link_response() -> requests.Response:


# This should be `(int, str, type)` but doesn't work in Python 3.7-3.8.
base_subclass_test_cases: List[Tuple[int, str, type]] = [
(400, '', errors.BadRequest), (400, 'INVALID_PARAMETER_VALUE', errors.BadRequest),
(400, 'INVALID_PARAMETER_VALUE', errors.InvalidParameterValue),
(400, 'REQUEST_LIMIT_EXCEEDED', errors.TooManyRequests), (400, '', IOError),
(401, '', errors.Unauthenticated), (401, '', IOError), (403, '', errors.PermissionDenied),
(403, '', IOError), (404, '', errors.NotFound), (404, '', IOError), (409, '', errors.ResourceConflict),
(409, 'ABORTED', errors.Aborted), (409, 'ABORTED', errors.ResourceConflict),
(409, 'ALREADY_EXISTS', errors.AlreadyExists), (409, 'ALREADY_EXISTS', errors.ResourceConflict),
(409, '', IOError), (429, '', errors.TooManyRequests),
(429, 'REQUEST_LIMIT_EXCEEDED', errors.TooManyRequests),
(429, 'REQUEST_LIMIT_EXCEEDED', errors.RequestLimitExceeded),
(429, 'RESOURCE_EXHAUSTED', errors.TooManyRequests),
(429, 'RESOURCE_EXHAUSTED', errors.ResourceExhausted), (429, '', IOError), (499, '', errors.Cancelled),
(499, '', IOError), (500, '', errors.InternalError), (500, 'UNKNOWN', errors.InternalError),
(500, 'UNKNOWN', errors.Unknown), (500, 'DATA_LOSS', errors.InternalError),
(500, 'DATA_LOSS', errors.DataLoss), (500, '', IOError), (501, '', errors.NotImplemented),
(501, '', IOError), (503, '', errors.TemporarilyUnavailable), (503, '', IOError),
(504, '', errors.DeadlineExceeded), (504, '', IOError), (444, '', errors.DatabricksError),
(444, '', IOError),
]
base_subclass_test_cases: List[Tuple[int, str,
type]] = [(400, '', errors.BadRequest),
(400, 'INVALID_PARAMETER_VALUE', errors.BadRequest),
(400, 'INVALID_PARAMETER_VALUE', errors.InvalidParameterValue),
(400, 'REQUEST_LIMIT_EXCEEDED', errors.TooManyRequests),
(400, '', IOError), (401, '', errors.Unauthenticated),
(401, '', IOError), (403, '', errors.PermissionDenied),
(403, '', IOError), (404, '', errors.NotFound),
(404, '', IOError), (409, '', errors.ResourceConflict),
(409, 'ABORTED', errors.Aborted),
(409, 'ABORTED', errors.ResourceConflict),
(409, 'ALREADY_EXISTS', errors.AlreadyExists),
(409, 'ALREADY_EXISTS', errors.ResourceConflict),
(409, '', IOError), (429, '', errors.TooManyRequests),
(429, 'REQUEST_LIMIT_EXCEEDED', errors.TooManyRequests),
(429, 'REQUEST_LIMIT_EXCEEDED', errors.RequestLimitExceeded),
(429, 'RESOURCE_EXHAUSTED', errors.TooManyRequests),
(429, 'RESOURCE_EXHAUSTED', errors.ResourceExhausted),
(429, '', IOError), (499, '', errors.Cancelled),
(499, '', IOError), (500, '', errors.InternalError),
(500, 'UNKNOWN', errors.InternalError),
(500, 'UNKNOWN', errors.Unknown),
(500, 'DATA_LOSS', errors.InternalError),
(500, 'DATA_LOSS', errors.DataLoss), (500, '', IOError),
(501, '', errors.NotImplemented), (501, '', IOError),
(503, '', errors.TemporarilyUnavailable), (503, '', IOError),
(504, '', errors.DeadlineExceeded), (504, '', IOError),
(444, '', errors.DatabricksError), (444, '', IOError), ]

subclass_test_cases = [(fake_valid_response('GET', x[0], x[1], 'nope'), x[2], 'nope')
for x in base_subclass_test_cases]
Expand Down

0 comments on commit cdff06d

Please sign in to comment.