Skip to content

Commit

Permalink
Update test_main.py
Browse files Browse the repository at this point in the history
  • Loading branch information
OlgaKonshina authored Mar 12, 2024
1 parent c977621 commit 60f9cc1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def test_read_main():

def test_predict_positive():
response = client.post("/predict/",
json={"text": "I like machine learning!"})
json={"text": "I love you!"})
json_data = response.json()
assert response.status_code == 200
assert json_data['Результат:'] == 'позитивный :)'
Expand All @@ -23,20 +23,20 @@ def test_predict_negative():
json={"text": "I hate machine learning!"})
json_data = response.json()
assert response.status_code == 200
assert json_data['label'] == 'NEGATIVE'
assert json_data['Результат:'] == 'негативный (('


def test_predict_russian_positive():
response = client.post("/predict/",
json={"text": "Я люблю учиться"})
json_data = response.json()
assert response.status_code == 200
assert json_data['label'] == 'POSITIVE'
assert json_data['Результат:'] == 'позитивный :)'


def test_predict_russian_negative():
response = client.post("/predict/",
json={"text": "Я ненавижу тебя"})
json_data = response.json()
assert response.status_code == 200
assert json_data['label'] == 'NEGATIVE'
assert json_data['Результат:'] == 'негативный (('

0 comments on commit 60f9cc1

Please sign in to comment.