Skip to content

Commit

Permalink
🔧 fix(test_database.py): add description field to FlowCreate object t…
Browse files Browse the repository at this point in the history
…o fix test failure caused by missing required field

🐛 fix(test_user.py): update error message and details for invalid UUID input in test_patch_user_wrong_id and test_delete_user_wrong_id to provide more specific information
  • Loading branch information
ogabrielluiz committed Nov 3, 2023
1 parent 5320da2 commit 780b0d6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/test_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
18 changes: 14 additions & 4 deletions tests/test_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}
]
}
Expand All @@ -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",
}
]
}
Expand Down

0 comments on commit 780b0d6

Please sign in to comment.