From ad552d7add40bfa44b26021b5d1374942dd7c74b Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Fri, 16 Jun 2023 19:11:13 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20refactor(test=5Fdatabase.py):=20?= =?UTF-8?q?remove=20unnecessary=20line=20breaks=20and=20whitespace=20This?= =?UTF-8?q?=20commit=20removes=20unnecessary=20line=20breaks=20and=20white?= =?UTF-8?q?space=20in=20the=20test=5Fdatabase.py=20file=20to=20improve=20c?= =?UTF-8?q?ode=20readability=20and=20consistency.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_database.py | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/tests/test_database.py b/tests/test_database.py index 8663881a5..cf824851b 100644 --- a/tests/test_database.py +++ b/tests/test_database.py @@ -57,8 +57,7 @@ def test_read_flows(client: TestClient, json_flow: str): assert response.json()["name"] == flow.name assert response.json()["data"] == flow.data - flow_style = FlowStyleCreate( - color="red", emoji="👍", flow_id=response.json()["id"]) + flow_style = FlowStyleCreate(color="red", emoji="👍", flow_id=response.json()["id"]) response = client.post( "api/v1/flow_styles/", json=jsonable_encoder(flow_style.dict()) ) @@ -129,8 +128,7 @@ def test_update_flow(client: TestClient, json_flow: str): description="updated description", data=data, ) - response = client.patch( - f"api/v1/flows/{flow_id}", json=updated_flow.dict()) + response = client.patch(f"api/v1/flows/{flow_id}", json=updated_flow.dict()) assert response.status_code == 200 assert response.json()["name"] == updated_flow.name @@ -246,12 +244,10 @@ def test_get_nonexistent_flow(client: TestClient): def test_update_flow_idempotency(client: TestClient, json_flow: str): flow_data = json.loads(json_flow) data = flow_data["data"] - flow_data = FlowCreate( - name="Test Flow", description="description", data=data) + flow_data = FlowCreate(name="Test Flow", description="description", data=data) response = client.post("api/v1/flows/", json=flow_data.dict()) flow_id = response.json()["id"] - updated_flow = FlowCreate( - name="Updated Flow", description="description", data=data) + updated_flow = FlowCreate(name="Updated Flow", description="description", data=data) response1 = client.put(f"api/v1/flows/{flow_id}", json=updated_flow.dict()) response2 = client.put(f"api/v1/flows/{flow_id}", json=updated_flow.dict()) assert response1.json() == response2.json() @@ -313,8 +309,7 @@ def test_create_flow_style(client: TestClient): def test_read_flow_styles(client: TestClient): response = client.get("api/v1/flow_styles/") assert response.status_code == 200 - flow_styles = [FlowStyleRead(**flow_style) - for flow_style in response.json()] + flow_styles = [FlowStyleRead(**flow_style) for flow_style in response.json()] assert not flow_styles # Create test data flow_style = FlowStyleCreate(color="red", emoji="🔴") @@ -323,8 +318,7 @@ def test_read_flow_styles(client: TestClient): # Check response data response = client.get("api/v1/flow_styles/") assert response.status_code == 200 - flow_styles = [FlowStyleRead(**flow_style) - for flow_style in response.json()] + flow_styles = [FlowStyleRead(**flow_style) for flow_style in response.json()] assert len(flow_styles) == 1 assert flow_styles[0].color == flow_style.color assert flow_styles[0].emoji == flow_style.emoji