Skip to content

Commit 8d5196c

Browse files
committed
Fixed lgtm checks and added coverage upload to codecov
1 parent 5ab7775 commit 8d5196c

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

.coveragerc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ omit =
33
*/site-packages/*
44
*/distutils/*
55
tests/*
6+
.tox/*

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,5 @@ jobs:
1919
run: pip install -r requirements/test.txt
2020
- name: Run Tox
2121
run: tox -e py
22+
- name: Upload Coverage to codecov
23+
run: bash <(curl -s https://codecov.io/bash)

imagekitio/file.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import json
1+
from json import dumps
22
from typing import Any, Dict
33

44
from .constants.errors import ERRORS
@@ -114,7 +114,7 @@ def update_file_details(self, file_id: str, options: dict):
114114
url = "{}/{}/details/".format(URL.BASE_URL.value, file_id)
115115
headers = {"Content-Type": "application/json"}
116116
headers.update(self.request.get_auth_headers())
117-
data = json.dumps(request_formatter(options))
117+
data = dumps(request_formatter(options))
118118
resp = self.request.request(method="Patch", url=url, headers=headers, data=data)
119119
if resp.status_code > 200:
120120
error = resp.json()
@@ -178,7 +178,7 @@ def purge_cache(self, file_url: str = None) -> Dict[str, Any]:
178178
headers.update(self.request.get_auth_headers())
179179
body = {"url": file_url}
180180
resp = self.request.request(
181-
"Post", headers=headers, url=url, data=json.dumps(body)
181+
"Post", headers=headers, url=url, data=dumps(body)
182182
)
183183
formatted_resp = camel_dict_to_snake_dict(resp.json())
184184
if resp.status_code > 204:

tox.ini

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@ skipsdist = True
55
[testenv]
66
passenv = *
77
deps = -rrequirements/test.txt
8-
commands = python -m unittest discover tests
8+
commands =
9+
coverage run --append -m unittest discover tests
10+
coverage report

0 commit comments

Comments
 (0)