Minor bugfix

This commit is contained in:
2024-04-02 11:40:26 +02:00
parent 6fc0d01189
commit 140c6e4678
2 changed files with 21 additions and 7 deletions

View File

@@ -21,7 +21,9 @@ class GenericClient(TestClient):
assert r_code == re.status_code assert r_code == re.status_code
return re.json() if r_code != 204 else None return re.json() if r_code != 204 else None
def post(self, url: str, obj: dict ={}, r_code:int =201, raw_response=False, *args, **kwargs): def post(
self, url: str, obj: dict = {}, r_code: int = 201, raw_response=False, *args, **kwargs
):
re = self.c.post( re = self.c.post(
url, data=json.dumps(obj), headers={"Content-Type": "application/json"}, *args, **kwargs url, data=json.dumps(obj), headers={"Content-Type": "application/json"}, *args, **kwargs
) )
@@ -37,7 +39,9 @@ class GenericClient(TestClient):
assert r_code == re.status_code assert r_code == re.status_code
return re.json() if not raw_response else re return re.json() if not raw_response else re
def patch(self, url: str, obj: dict ={}, r_code:int =200, raw_response=False, *args, **kwargs): def patch(
self, url: str, obj: dict = {}, r_code: int = 200, raw_response=False, *args, **kwargs
):
re = self.c.patch( re = self.c.patch(
url, data=json.dumps(obj), headers={"Content-Type": "application/json"}, *args, **kwargs url, data=json.dumps(obj), headers={"Content-Type": "application/json"}, *args, **kwargs
) )
@@ -103,4 +107,4 @@ class GenericClient(TestClient):
assert len(re) == 0 assert len(re) == 0
# GET # GET
self.get(f"{url}{obj_id}", parse_json=False, r_code:int =404) self.get(f"{url}{obj_id}", parse_json=False, r_code=404)

View File

@@ -33,4 +33,14 @@ setup(
license="MIT", license="MIT",
python_requires=">=3.12", python_requires=">=3.12",
install_requires=requirements, install_requires=requirements,
keywords=[
"creyPY",
"Python",
"FastAPI",
"shortcuts",
"snippets",
"utils",
"personal library",
],
platforms="any",
) )