Tbruand
commited on
Commit
·
d2df4a4
1
Parent(s):
924d303
test(handler): vérifie le format markdown et la présence des scores de prédiction
Browse files- tests/test_handler.py +8 -9
tests/test_handler.py
CHANGED
@@ -5,14 +5,13 @@ sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")
|
|
5 |
from app.handler import predict
|
6 |
|
7 |
def test_zero_shot_prediction_output():
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
label_1, score_1 = predict(text_1)
|
12 |
-
label_2, score_2 = predict(text_2)
|
13 |
|
14 |
-
print(
|
15 |
-
print(f"Prediction 2: {label_2} ({score_2:.2f})")
|
16 |
|
17 |
-
|
18 |
-
assert
|
|
|
|
|
|
|
|
5 |
from app.handler import predict
|
6 |
|
7 |
def test_zero_shot_prediction_output():
|
8 |
+
text = "Tu es complètement stupide"
|
9 |
+
output = predict(text)
|
|
|
|
|
|
|
10 |
|
11 |
+
print("Résultat brut :", output)
|
|
|
12 |
|
13 |
+
# Vérifie que le format markdown est respecté
|
14 |
+
assert "### Résultat de la classification" in output
|
15 |
+
assert "**toxique**" in output
|
16 |
+
assert "**non-toxique**" in output
|
17 |
+
assert "%" in output
|