Skip to content

Commit 9173692

Browse files
committed
tests passing
1 parent c79e90d commit 9173692

File tree

9 files changed

+181
-332
lines changed

9 files changed

+181
-332
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ repos:
3838
args: [
3939
--max-line-length=127,
4040
--max-public-methods=32,
41-
--max-args=9,
42-
'--disable=too-few-public-methods,logging-fstring-interpolation,too-many-instance-attributes,no-else-return,too-many-locals,no-self-use,duplicate-code,broad-except,logging-not-lazy,unspecified-encoding, unused-wildcard-import,missing-function-docstring,missing-module-docstring,import-error,wildcard-import,invalid-name,redefined-outer-name,no-name-in-module',
41+
--max-args=13,
42+
'--disable=too-few-public-methods,logging-fstring-interpolation,too-many-instance-attributes,no-else-return,too-many-locals,no-self-use,duplicate-code,broad-except,logging-not-lazy,unspecified-encoding, unused-wildcard-import,missing-function-docstring,missing-module-docstring,import-error,wildcard-import,invalid-name,redefined-outer-name,no-name-in-module, arguments-differ',
4343
'--good-names=ip,rc,eval'
4444
]

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
requests>=2,<3
1+
requests>=2,<3
2+
abstract-http-client
Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,6 @@
1-
from requests import Response
2-
3-
41
class SandboxRestException(Exception):
52
""" Base Exception Class inside Rest client class """
63

7-
def __init__(self, message: str, response: Response = None):
8-
super().__init__(message)
9-
self.message = message
10-
self.response = response
11-
12-
def __str__(self):
13-
return self._format_err_msg(self.message, self.response)
14-
15-
def _format_err_msg(self, custom_err_msg="Failed Api Call", response: Response = None) -> str:
16-
err_msg = f"Sandbox API Error: {custom_err_msg}"
17-
18-
if response:
19-
err_msg += f"\n{self._format_response_msg(response)}"
20-
return err_msg
21-
22-
@staticmethod
23-
def _format_response_msg(response: Response):
24-
return (
25-
f"Response: {response.status_code}, Reason: {response.reason}\n"
26-
f"Request URL: {response.request.url}\n"
27-
f"Request Headers: {response.request.headers}"
28-
)
29-
304

315
class SandboxRestAuthException(SandboxRestException):
32-
"""Failed auth action"""
6+
""" Failed login action """

0 commit comments

Comments
 (0)