From 3a3c3793edce61b5fd5a8f64f1f7858e9410872f Mon Sep 17 00:00:00 2001 From: leonard_montalbano Date: Wed, 15 Jun 2022 16:03:31 +0200 Subject: [PATCH] =?UTF-8?q?tests=20unitaires=20formsemestre=20+=20ajout=20?= =?UTF-8?q?des=20fields=20=C3=A0=20tests=20dans=20tools=5Ftest=5Fapi.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/api/test_api_formsemestre.py | 95 +++++++++++------------------- tests/api/tools_test_api.py | 91 +++++++++++++++++++++++++++- 2 files changed, 124 insertions(+), 62 deletions(-) diff --git a/tests/api/test_api_formsemestre.py b/tests/api/test_api_formsemestre.py index a073e8060..99df59455 100644 --- a/tests/api/test_api_formsemestre.py +++ b/tests/api/test_api_formsemestre.py @@ -49,44 +49,19 @@ def test_formsemestre(api_headers): assert verify_fields(formsemestre, FSEM_FIELDS) -def test_etudiant_bulletin(api_headers): - """ - Route: - """ - formsemestre_id = 1 - r = requests.get( - f"{API_URL}/etudiant/etudid/1/formsemestre/{formsemestre_id}/bulletin", - headers=api_headers, - verify=CHECK_CERTIFICATE, - ) - assert r.status_code == 200 - bull_a = r.json() - - r = requests.get( - f"{API_URL}/etudiant/nip/{NIP}/formsemestre/{formsemestre_id}/bulletin", - headers=api_headers, - verify=CHECK_CERTIFICATE, - ) - assert r.status_code == 200 - bull_b = r.json() - - r = requests.get( - f"{API_URL}/etudiant/ine/{INE}/formsemestre/{formsemestre_id}/bulletin", - headers=api_headers, - verify=CHECK_CERTIFICATE, - ) - assert r.status_code == 200 - bull_c = r.json() - # elimine les dates de publication pour comparer les autres champs - del bull_a["date"] - del bull_b["date"] - del bull_c["date"] - assert bull_a == bull_b == bull_c +# XXX TODO ajouter une etape_apo dans la base de test +# def test_formsemestre_apo(api_headers): +# r = requests.get( +# API_URL + "/formation/apo/", +# headers=api_headers, +# verify=CHECK_CERTIFICATE, +# ) +# assert r.status_code == 200 def test_bulletins(api_headers): """ - Route: + Route: /formsemestre//bulletins """ r = requests.get( API_URL + "/formsemestre/1/bulletins", @@ -106,6 +81,32 @@ def test_bulletins(api_headers): # assert r.status_code == 200 +# def test_formsemestre_etudiants(api_headers): +# """ +# Route: /formsemestre//etudiants, /formsemestre//etudiants/demissionnaires, /formsemestre//etudiants/defaillants +# """ +# r = requests.get( +# API_URL + "/formsemestre//etudiants", +# headers=api_headers, +# verify=CHECK_CERTIFICATE, +# ) +# assert r.status_code == 200 +# +# r = requests.get( +# API_URL + "/formsemestre//etudiants/demissionnaires", +# headers=api_headers, +# verify=CHECK_CERTIFICATE, +# ) +# assert r.status_code == 200 +# +# r = requests.get( +# API_URL + "/formsemestre//etudiants/defaillants", +# headers=api_headers, +# verify=CHECK_CERTIFICATE, +# ) +# assert r.status_code == 200 + + def test_formsemestre_programme(api_headers): """ Route: /formsemestre/1/programme @@ -138,32 +139,6 @@ def test_formsemestre_programme(api_headers): assert verify_fields(sae, MODIMPL_FIELDS) -# def test_formsemestre_etudiants(api_headers): -# """ -# Route: /formsemestre//etudiants, /formsemestre//etudiants/demissionnaires, /formsemestre//etudiants/defaillants -# """ -# r = requests.get( -# API_URL + "/formsemestre//etudiants", -# headers=api_headers, -# verify=CHECK_CERTIFICATE, -# ) -# assert r.status_code == 200 -# -# r = requests.get( -# API_URL + "/formsemestre//etudiants/demissionnaires", -# headers=api_headers, -# verify=CHECK_CERTIFICATE, -# ) -# assert r.status_code == 200 -# -# r = requests.get( -# API_URL + "/formsemestre//etudiants/defaillants", -# headers=api_headers, -# verify=CHECK_CERTIFICATE, -# ) -# assert r.status_code == 200 - - def test_etat_evals( api_headers, ): diff --git a/tests/api/tools_test_api.py b/tests/api/tools_test_api.py index a71a7604d..a86b9ec1d 100644 --- a/tests/api/tools_test_api.py +++ b/tests/api/tools_test_api.py @@ -78,12 +78,12 @@ ETUD_FIELDS = { } FORMATION_FIELDS = { - "id", + "dept_id", "acronyme", "titre_officiel", "formation_code", "code_specialite", - "dept_id", + "id", "titre", "version", "type_parcours", @@ -91,6 +91,63 @@ FORMATION_FIELDS = { "formation_id", } +FORMATION_EXPORT_FIELDS = { + "dept_id", + "acronyme", + "titre_officiel", + "formation_code", + "code_specialite", + "id", + "titre", + "version", + "type_parcours", + "referentiel_competence_id", + "formation_id", + "ue", +} + +FORMATION_EXPORT_UE_FIELDS = { + "acronyme", + "numero", + "titre", + "type", + "ue_code", + "ects", + "is_external", + "code_apogee", + "coefficient", + "semestre_idx", + "color", + "reference", + "matiere", +} + +FORMATION_EXPORT_UE_MATIERE_FIELDS = { + "titre", + "numero", + "module", +} + +FORMATION_EXPORT_UE_MATIERE_MODULE_FIELDS = { + "titre", + "abbrev", + "code", + "heures_cours", + "heures_td", + "coefficient", + "ects", + "semestre_id", + "numero", + "code_apogee", + "module_type", + "coefficients", +} + +FORMATION_EXPORT_UE_MATIERE_MODULE_COEF_FIELDS = { + "ue_reference", + "coef", +} + FORMSEMESTRE_FIELDS = [ "titre", "gestion_semestrielle", @@ -432,3 +489,33 @@ BULLETIN_SEMESTRE_ECTS_FIELDS = {"acquis", "total"} BULLETIN_SEMESTRE_NOTES_FIELDS = {"value", "min", "moy", "max"} BULLETIN_SEMESTRE_RANG_FIELDS = {"value", "total"} + + +EVAL_FIELDS = { + "id", + "description", + "datetime_epreuve", + "heure_fin", + "coefficient", + "comptee", + "inscrits", + "manquantes", + "ABS", + "ATT", + "EXC", + "saisie_notes", +} + +SAISIE_NOTES_FIELDS = {"datetime_debut", "datetime_fin", "datetime_mediane"} + +ABSENCES_FIELDS = { + "jour", + "matin", + "estabs", + "estjust", + "description", + "begin", + "end", +} + +ABSENCES_GROUP_ETAT_FIELDS = {"etudid", "list_abs"}