Skip to content

Commit

Permalink
Update test_main.py
Browse files Browse the repository at this point in the history
  • Loading branch information
NetZach777 authored Mar 27, 2024
1 parent 763c916 commit 1139a2e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
def test_predict_sentiment_positive():
response = client.post(API_ENDPOINT, json={"text": "I love FastAPI!"})
assert response.status_code == 200
assert response.json() == {"sentiment": "positif"}
assert response.json() == {"sentiment": "positive"}

# Teste la prédiction négative pour un texte négatif
def test_predict_sentiment_negative():
response = client.post(API_ENDPOINT, json={"text": "I hate Mondays!"})
assert response.status_code == 200
assert response.json() == {"sentiment": "négatif"}
assert response.json() == {"sentiment": "negative"}

# Teste la gestion d'une requête sans corps
def test_predict_sentiment_no_body():
Expand All @@ -41,3 +41,4 @@ def test_predict_sentiment_wrong_content_type():
def test_predict_sentiment_get_method_not_allowed():
response = client.get(API_ENDPOINT)
assert response.status_code == 405

0 comments on commit 1139a2e

Please sign in to comment.