diff --git a/.gitignore b/.gitignore index fb1717b..d72d191 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ -.vscode # Cached python code __pycache__ # Cached test code -.pytest_cache \ No newline at end of file +.pytest_cache +# Coverage reports +.coverage +coverage.xml \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..e444eb0 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,16 @@ +{ + "configurations":[ + { + "name": "Python: Debug Tests", + "request": "launch", + "program": "${file}", + "purpose": ["debug-test"], + "console": "integratedTerminal", + "env": { + "PYTEST_ADDOPTS": "--no-cov" + }, + "type": "python", + "justMyCode": false + } + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..8e0c856 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,11 @@ +{ + "python.testing.pytestArgs": [ + "-v", + "--cov=akauntingpy", + "--cov-report=xml", + "--pdb", + "tests/" + ], + "python.testing.unittestEnabled": false, + "python.testing.pytestEnabled": true +} \ No newline at end of file diff --git a/akauntingpy/api.py b/akauntingpy/api.py index 3c24b32..0751404 100644 --- a/akauntingpy/api.py +++ b/akauntingpy/api.py @@ -57,10 +57,7 @@ class Client(object): print(response) response_ = response.json() print(response_) - # try: - # result = response_['status'] - # except KeyError: - # result = response_['status_code'] + if response.status_code == 401: raise exceptions.MissingPermission(response_['message']) elif response.status_code == 422: