Removed security vul in haystack
Browse files- backend/tests/test_api.py +2 -3
- pyproject.toml +1 -1
backend/tests/test_api.py
CHANGED
|
@@ -35,6 +35,7 @@ def test_feedback_validation_error():
|
|
| 35 |
assert "same length" in response.json()["detail"]
|
| 36 |
|
| 37 |
|
|
|
|
| 38 |
def test_successful_feedback():
|
| 39 |
"""Test successful grading of multiple problems"""
|
| 40 |
response = client.post(
|
|
@@ -57,8 +58,6 @@ def test_successful_feedback():
|
|
| 57 |
assert "feedback" in result
|
| 58 |
assert len(result["feedback"]) == 2
|
| 59 |
|
| 60 |
-
# Check that responses start with either "Correct" or "Incorrect"
|
| 61 |
for feedback in result["feedback"]:
|
| 62 |
-
assert feedback.startswith(("Correct", "Incorrect"))
|
| 63 |
-
# Check that there's an explanation after the classification
|
| 64 |
assert len(feedback.split(". ")) >= 2
|
|
|
|
| 35 |
assert "same length" in response.json()["detail"]
|
| 36 |
|
| 37 |
|
| 38 |
+
# this test can be a bit flaky, but it's not a big deal (because it's checking the content of the response. Correct/Incorrect might be prefaced by /n or something)
|
| 39 |
def test_successful_feedback():
|
| 40 |
"""Test successful grading of multiple problems"""
|
| 41 |
response = client.post(
|
|
|
|
| 58 |
assert "feedback" in result
|
| 59 |
assert len(result["feedback"]) == 2
|
| 60 |
|
|
|
|
| 61 |
for feedback in result["feedback"]:
|
| 62 |
+
assert feedback.strip().startswith(("Correct", "Incorrect"))
|
|
|
|
| 63 |
assert len(feedback.split(". ")) >= 2
|
pyproject.toml
CHANGED
|
@@ -23,7 +23,7 @@ dependencies = [
|
|
| 23 |
"openai>=1.12.0",
|
| 24 |
"pytest-dotenv>=0.5.2",
|
| 25 |
"unstructured",
|
| 26 |
-
"haystack-ai==2.
|
| 27 |
"qdrant-client==1.13.3",
|
| 28 |
"qdrant-haystack==3.3.1",
|
| 29 |
"ipykernel",
|
|
|
|
| 23 |
"openai>=1.12.0",
|
| 24 |
"pytest-dotenv>=0.5.2",
|
| 25 |
"unstructured",
|
| 26 |
+
"haystack-ai==2.3.1",
|
| 27 |
"qdrant-client==1.13.3",
|
| 28 |
"qdrant-haystack==3.3.1",
|
| 29 |
"ipykernel",
|