File size: 1,098 Bytes
95110b5 3ece550 95110b5 d2df4a4 95110b5 d2df4a4 95110b5 d2df4a4 0cf4a6c d2df4a4 188a80c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
from app.handler import predict
def test_zero_shot_prediction_output():
text = "Tu es complètement stupide"
output = predict(text)
print("Résultat brut :", output)
# Vérifie que le format markdown est respecté
assert "### Résultat de la classification" in output
assert "**toxique**" in output
assert "**non-toxique**" in output
assert "%" in output
def test_few_shot_prediction_output():
from app.handler import predict
text = "Tu es un abruti fini"
output = predict(text, model_type="few-shot")
print("Résultat few-shot :", output)
assert "### Résultat de la classification" in output
assert "toxique" in output or "non-toxique" in output
def test_fine_tuned_prediction_output():
text = "Tu es stupide"
output = predict(text, model_type="fine-tuned")
print("Résultat fine-tuned :", output)
assert "### Résultat de la classification" in output
assert "toxique" in output or "non-toxique" in output
|