Spaces:
Sleeping
Sleeping
Delete tests/test_api.py
Browse files- tests/test_api.py +0 -44
tests/test_api.py
DELETED
|
@@ -1,44 +0,0 @@
|
|
| 1 |
-
from fastapi.testclient import TestClient
|
| 2 |
-
from App.main import app
|
| 3 |
-
|
| 4 |
-
client = TestClient(app)
|
| 5 |
-
|
| 6 |
-
def test_predict_endpoint():
|
| 7 |
-
|
| 8 |
-
emp_caract = {
|
| 9 |
-
"genre": "M",
|
| 10 |
-
"statut_marital": "Marié(e)",
|
| 11 |
-
"departement": "Commercial",
|
| 12 |
-
"poste": "Cadre Commercial",
|
| 13 |
-
"domaine_etude": "Infra & Cloud",
|
| 14 |
-
"frequence_deplacement": "Occasionnel",
|
| 15 |
-
"heure_supplementaires": "false",
|
| 16 |
-
"evolution_cat_evol": "hausse",
|
| 17 |
-
"categorie_employe": "employe-experimente",
|
| 18 |
-
"satisfaction_employee_nature_travail": 3,
|
| 19 |
-
"nombre_participation_pee": 0,
|
| 20 |
-
"ecart_note_evaluation": 1,
|
| 21 |
-
"revenu_mensuel": 10609,
|
| 22 |
-
"distance_domicile_travail": 1,
|
| 23 |
-
"satisfaction_globale": 2.00,
|
| 24 |
-
"niveau_education": 2,
|
| 25 |
-
"note_evaluation_actuelle": 3,
|
| 26 |
-
"satisfaction_employee_equipe": 3,
|
| 27 |
-
"age": 37,
|
| 28 |
-
"revenu_par_annee_experience_interne": 9093,
|
| 29 |
-
"satisfaction_employee_equilibre_pro_perso": 1,
|
| 30 |
-
"nombre_experiences_precedentes": 5,
|
| 31 |
-
"annees_dans_l_entreprise": 14,
|
| 32 |
-
"nb_formations_suivies": 2,
|
| 33 |
-
"revenu_par_annee_experience_totale": 7488,
|
| 34 |
-
"ratio_sans_promotion": 0,
|
| 35 |
-
"satisfaction_employee_environnement": 1,
|
| 36 |
-
"exp_hors_entreprise": 3,
|
| 37 |
-
"mobilite_promotion": -10,
|
| 38 |
-
"annees_depuis_la_derniere_promotion": 11}
|
| 39 |
-
|
| 40 |
-
response = client.post("/predict", json = emp_caract)
|
| 41 |
-
|
| 42 |
-
assert response.status_code == 200
|
| 43 |
-
assert "Prediction" in response.json()
|
| 44 |
-
assert "Probabilite_depart" in response.json()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|