Spaces:
Sleeping
Sleeping
test: align test fixtures with string-based input schema
Browse files- tests/conftest.py +4 -3
- tests/test_db.py +3 -2
tests/conftest.py
CHANGED
|
@@ -8,9 +8,10 @@ from app.db.session import get_db
|
|
| 8 |
TEST_API_KEY = "test-secret-key"
|
| 9 |
|
| 10 |
VALID_PAYLOAD = {
|
| 11 |
-
"age": 35, "genre":
|
| 12 |
"poste": "Consultant", "domaine_etude": "Infra & Cloud",
|
| 13 |
-
"niveau_education": 3, "
|
|
|
|
| 14 |
"annee_experience_totale": 10, "annees_dans_l_entreprise": 5,
|
| 15 |
"annees_dans_le_poste_actuel": 2, "annees_sous_responsable_actuel": 3,
|
| 16 |
"annees_depuis_la_derniere_promotion": 1,
|
|
@@ -21,7 +22,7 @@ VALID_PAYLOAD = {
|
|
| 21 |
"satisfaction_employee_nature_travail": 4,
|
| 22 |
"satisfaction_employee_equipe": 3,
|
| 23 |
"satisfaction_employee_equilibre_pro_perso": 2,
|
| 24 |
-
"heure_supplementaires":
|
| 25 |
"distance_domicile_travail": 10, "revenu_mensuel": 5000,
|
| 26 |
}
|
| 27 |
|
|
|
|
| 8 |
TEST_API_KEY = "test-secret-key"
|
| 9 |
|
| 10 |
VALID_PAYLOAD = {
|
| 11 |
+
"age": 35, "genre": "M", "statut_marital": "Marié(e)",
|
| 12 |
"poste": "Consultant", "domaine_etude": "Infra & Cloud",
|
| 13 |
+
"niveau_education": 3, "departement": "Ventes", "niveau_hierarchique_poste": 2,
|
| 14 |
+
"nombre_experiences_precedentes": 2,
|
| 15 |
"annee_experience_totale": 10, "annees_dans_l_entreprise": 5,
|
| 16 |
"annees_dans_le_poste_actuel": 2, "annees_sous_responsable_actuel": 3,
|
| 17 |
"annees_depuis_la_derniere_promotion": 1,
|
|
|
|
| 22 |
"satisfaction_employee_nature_travail": 4,
|
| 23 |
"satisfaction_employee_equipe": 3,
|
| 24 |
"satisfaction_employee_equilibre_pro_perso": 2,
|
| 25 |
+
"heure_supplementaires": "Non", "frequence_deplacement": "Occasionnel",
|
| 26 |
"distance_domicile_travail": 10, "revenu_mensuel": 5000,
|
| 27 |
}
|
| 28 |
|
tests/test_db.py
CHANGED
|
@@ -6,8 +6,9 @@ from app.db.crud import log_prediction
|
|
| 6 |
from app.schemas.prediction import PredictionInput, PredictionOutput
|
| 7 |
|
| 8 |
VALID_INPUT = PredictionInput(
|
| 9 |
-
age=35, genre=
|
| 10 |
domaine_etude="Infra & Cloud", niveau_education=3,
|
|
|
|
| 11 |
nombre_experiences_precedentes=2, annee_experience_totale=10,
|
| 12 |
annees_dans_l_entreprise=5, annees_dans_le_poste_actuel=2,
|
| 13 |
annees_sous_responsable_actuel=3, annees_depuis_la_derniere_promotion=1,
|
|
@@ -16,7 +17,7 @@ VALID_INPUT = PredictionInput(
|
|
| 16 |
nombre_participation_pee=1, satisfaction_employee_environnement=3,
|
| 17 |
satisfaction_employee_nature_travail=4, satisfaction_employee_equipe=3,
|
| 18 |
satisfaction_employee_equilibre_pro_perso=2,
|
| 19 |
-
heure_supplementaires=
|
| 20 |
distance_domicile_travail=10, revenu_mensuel=5000,
|
| 21 |
)
|
| 22 |
VALID_OUTPUT = PredictionOutput(prediction=0, label="Reste", probabilite=0.30)
|
|
|
|
| 6 |
from app.schemas.prediction import PredictionInput, PredictionOutput
|
| 7 |
|
| 8 |
VALID_INPUT = PredictionInput(
|
| 9 |
+
age=35, genre="M", statut_marital="Marié(e)", poste="Consultant",
|
| 10 |
domaine_etude="Infra & Cloud", niveau_education=3,
|
| 11 |
+
departement="Ventes", niveau_hierarchique_poste=2,
|
| 12 |
nombre_experiences_precedentes=2, annee_experience_totale=10,
|
| 13 |
annees_dans_l_entreprise=5, annees_dans_le_poste_actuel=2,
|
| 14 |
annees_sous_responsable_actuel=3, annees_depuis_la_derniere_promotion=1,
|
|
|
|
| 17 |
nombre_participation_pee=1, satisfaction_employee_environnement=3,
|
| 18 |
satisfaction_employee_nature_travail=4, satisfaction_employee_equipe=3,
|
| 19 |
satisfaction_employee_equilibre_pro_perso=2,
|
| 20 |
+
heure_supplementaires="Non", frequence_deplacement="Occasionnel",
|
| 21 |
distance_domicile_travail=10, revenu_mensuel=5000,
|
| 22 |
)
|
| 23 |
VALID_OUTPUT = PredictionOutput(prediction=0, label="Reste", probabilite=0.30)
|