Skip to content

Commit

Permalink
Update tests error messages to be compatible with voluptuous 0.14.0
Browse files Browse the repository at this point in the history
The commit

alecthomas/voluptuous@41bc53d

which was introduced in version 0.14.0 of voluptuous library,
improves the error messages for invalid keys. To make Gnocchi
tests compatible with this new version, we need to update some
error messages validation to use the newest error messages from
voluptuous parser.

(cherry picked from commit 3741cc8)
  • Loading branch information
pedro-martins authored and mergify[bot] committed Dec 3, 2023
1 parent ff293e1 commit dd9b284
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions gnocchi/tests/functional/gabbits/search.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ tests:
status: 400
response_json_paths:
$.description.cause: "Invalid input"
$.description.reason: "/^extra keys not allowed @ data/"
$.description.reason: "value must not be one of ['id'] @ data['like']['id']"
$.description.detail: ["like", "id"]

- name: search like list id
Expand All @@ -67,7 +67,7 @@ tests:
status: 400
response_json_paths:
$.description.cause: "Invalid input"
$.description.reason: "/^extra keys not allowed @ data/"
$.description.reason: "value must not be one of ['id'] @ data['like']['id']"
$.description.detail: ["like", "id"]

- name: search invalid ne value
Expand Down
2 changes: 1 addition & 1 deletion gnocchi/tests/test_rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1882,7 +1882,7 @@ def test_search_resources_invalid_query(self):
result_description = result.json['description']
self.assertEqual("Invalid input", result_description['cause'])
self.assertIn(
"extra keys not allowed @ data[", result_description['reason']
"not a valid value @ data['wrongoperator']", result_description['reason']
)


Expand Down

0 comments on commit dd9b284

Please sign in to comment.