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
Files changed (1) hide show
  1. 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
- text_1 = "Tu es complètement stupide"
9
- text_2 = "Je te remercie pour ton aide"
10
-
11
- label_1, score_1 = predict(text_1)
12
- label_2, score_2 = predict(text_2)
13
 
14
- print(f"Prediction 1: {label_1} ({score_1:.2f})")
15
- print(f"Prediction 2: {label_2} ({score_2:.2f})")
16
 
17
- assert label_1 in ["toxique", "non-toxique"]
18
- assert label_2 in ["toxique", "non-toxique"]
 
 
 
 
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