Skip to content

Commit

Permalink
chore(commands): correct error message
Browse files Browse the repository at this point in the history
  • Loading branch information
laurent-laporte-pro committed Mar 14, 2024
1 parent f363f9e commit ddfa8db
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def check_matrices(
if values_matrix and (less_term_matrix or greater_term_matrix or equal_term_matrix):
raise ValueError(
"You cannot fill 'values' (matrix before v8.7) and a matrix term:"
" less_term_matrix, greater_term_matrix or equal_term_matrix (matrices since v8.7)"
" 'less_term_matrix', 'greater_term_matrix' or 'equal_term_matrix' (matrices since v8.7)"
)
return values

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -511,10 +511,11 @@ def test_lifecycle__nominal(self, client: TestClient, user_access_token: str, st
headers=user_headers,
)
assert res.status_code == 422
assert (
res.json()["description"]
== "You cannot fill 'values' (matrix before v8.7) and a matrix term: less_term_matrix (matrices since v8.7)"
)
description = res.json()["description"]
assert "cannot fill 'values'" in description
assert "'less_term_matrix'" in description
assert "'greater_term_matrix'" in description
assert "'equal_term_matrix'" in description

# Creation with wrong matrix according to version: Should fail
res = client.post(
Expand All @@ -531,7 +532,8 @@ def test_lifecycle__nominal(self, client: TestClient, user_access_token: str, st
headers=user_headers,
)
assert res.status_code == 422
assert res.json()["description"] == "You cannot fill a 'matrix_term' as these values refer to v8.7+ studies"
description = res.json()["description"]
assert description == "You cannot fill a 'matrix_term' as these values refer to v8.7+ studies"

# Wrong matrix shape
wrong_matrix = np.ones((352, 3))
Expand Down

0 comments on commit ddfa8db

Please sign in to comment.