From 780b0d68d896e1a8479dae067ee21caa805bd72f Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Thu, 2 Nov 2023 22:19:58 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20fix(test=5Fdatabase.py):=20add?= =?UTF-8?q?=20description=20field=20to=20FlowCreate=20object=20to=20fix=20?= =?UTF-8?q?test=20failure=20caused=20by=20missing=20required=20field=20?= =?UTF-8?q?=F0=9F=90=9B=20fix(test=5Fuser.py):=20update=20error=20message?= =?UTF-8?q?=20and=20details=20for=20invalid=20UUID=20input=20in=20test=5Fp?= =?UTF-8?q?atch=5Fuser=5Fwrong=5Fid=20and=20test=5Fdelete=5Fuser=5Fwrong?= =?UTF-8?q?=5Fid=20to=20provide=20more=20specific=20information?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_database.py | 2 +- tests/test_user.py | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/tests/test_database.py b/tests/test_database.py index 21f0cec17..2aaeed8fe 100644 --- a/tests/test_database.py +++ b/tests/test_database.py @@ -38,7 +38,7 @@ def test_create_flow( assert response.json()["name"] == flow.name assert response.json()["data"] == flow.data # flow is optional so we can create a flow without a flow - flow = FlowCreate(name="Test Flow") + flow = FlowCreate(name="Test Flow", description="description") response = client.post( "api/v1/flows/", json=flow.dict(exclude_unset=True), headers=logged_in_headers ) diff --git a/tests/test_user.py b/tests/test_user.py index 49962c8d1..b4f18cbea 100644 --- a/tests/test_user.py +++ b/tests/test_user.py @@ -212,9 +212,14 @@ def test_patch_user_wrong_id(client, active_user, logged_in_headers): assert response.json() == { "detail": [ { + "type": "uuid_parsing", "loc": ["path", "user_id"], - "msg": "value is not a valid uuid", - "type": "type_error.uuid", + "msg": "Input should be a valid UUID, invalid character: expected an optional prefix of `urn:uuid:` followed by [0-9a-fA-F-], found `w` at 1", + "input": "wrong_id", + "ctx": { + "error": "invalid character: expected an optional prefix of `urn:uuid:` followed by [0-9a-fA-F-], found `w` at 1" + }, + "url": "https://errors.pydantic.dev/2.4/v/uuid_parsing", } ] } @@ -234,9 +239,14 @@ def test_delete_user_wrong_id(client, test_user, super_user_headers): assert response.json() == { "detail": [ { + "type": "uuid_parsing", "loc": ["path", "user_id"], - "msg": "value is not a valid uuid", - "type": "type_error.uuid", + "msg": "Input should be a valid UUID, invalid character: expected an optional prefix of `urn:uuid:` followed by [0-9a-fA-F-], found `w` at 1", + "input": "wrong_id", + "ctx": { + "error": "invalid character: expected an optional prefix of `urn:uuid:` followed by [0-9a-fA-F-], found `w` at 1" + }, + "url": "https://errors.pydantic.dev/2.4/v/uuid_parsing", } ] }