From 64038687b774864a4a6b7143d401d36ddf3df4c1 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Sat, 27 Jul 2024 14:34:20 +0200 Subject: [PATCH] Fixes for unit tests --- tests/api/test_api_partitions.py | 4 +-- tests/conftest.py | 1 + .../results/formsemestre_resultat.json | 32 ++++++++++++++----- 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/tests/api/test_api_partitions.py b/tests/api/test_api_partitions.py index 90f475eec..aa4681d4c 100644 --- a/tests/api/test_api_partitions.py +++ b/tests/api/test_api_partitions.py @@ -65,8 +65,8 @@ def test_formsemestre_partition(api_headers): headers = api_headers formsemestre_id = 1 partitions = GET(f"/formsemestre/{formsemestre_id}/partitions", headers=headers) - # au départ, pas de partitions - assert partitions == {} + # au départ, une partition (TD avec groupes A et B) + assert len(partitions) == 1 # --- Création partition partition_d = { "partition_name": "T&Dé", diff --git a/tests/conftest.py b/tests/conftest.py index 58ca1c111..24b00538f 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,5 +1,6 @@ import pytest +import flask from flask import g from flask_login import login_user diff --git a/tests/ressources/results/formsemestre_resultat.json b/tests/ressources/results/formsemestre_resultat.json index 354324e7f..d6187aebc 100644 --- a/tests/ressources/results/formsemestre_resultat.json +++ b/tests/ressources/results/formsemestre_resultat.json @@ -50,8 +50,9 @@ "moy_sae_14_3": "17.83", "moy_sae_15_3": "~", "ues_validables": "3/3", - "nbabs": 0, + "nbabs": 1, "nbabsjust": 0, + "part_2": "", "code_cursus": "S1", "bac": "", "specialite": "", @@ -109,8 +110,9 @@ "moy_sae_14_3": "10.74", "moy_sae_15_3": "~", "ues_validables": "3/3", - "nbabs": 2, + "nbabs": 0, "nbabsjust": 0, + "part_2": "", "code_cursus": "S1", "bac": "", "specialite": "", @@ -170,6 +172,7 @@ "ues_validables": "2/3", "nbabs": 0, "nbabsjust": 0, + "part_2": "", "code_cursus": "S1", "bac": "", "specialite": "", @@ -229,6 +232,7 @@ "ues_validables": "2/3", "nbabs": 0, "nbabsjust": 0, + "part_2": "", "code_cursus": "S1", "bac": "", "specialite": "", @@ -286,8 +290,9 @@ "moy_sae_14_3": "11.09", "moy_sae_15_3": "~", "ues_validables": "1/3", - "nbabs": 3, + "nbabs": 0, "nbabsjust": 0, + "part_2": "", "code_cursus": "S1", "bac": "", "specialite": "", @@ -347,6 +352,7 @@ "ues_validables": "2/3", "nbabs": 0, "nbabsjust": 0, + "part_2": "", "code_cursus": "S1", "bac": "", "specialite": "", @@ -404,8 +410,9 @@ "moy_sae_14_3": "05.17", "moy_sae_15_3": "~", "ues_validables": "1/3", - "nbabs": 3, + "nbabs": 0, "nbabsjust": 0, + "part_2": "", "code_cursus": "S1", "bac": "", "specialite": "", @@ -465,6 +472,7 @@ "ues_validables": "0/3", "nbabs": 0, "nbabsjust": 0, + "part_2": "", "code_cursus": "S1", "bac": "", "specialite": "", @@ -524,6 +532,7 @@ "ues_validables": "0/3", "nbabs": 0, "nbabsjust": 0, + "part_2": "", "code_cursus": "S1", "bac": "", "specialite": "", @@ -583,6 +592,7 @@ "ues_validables": "0/3", "nbabs": 0, "nbabsjust": 0, + "part_2": "", "code_cursus": "S1", "bac": "", "specialite": "", @@ -642,6 +652,7 @@ "ues_validables": "", "nbabs": 2, "nbabsjust": 0, + "part_2": "D\u00e9f.", "code_cursus": "S1", "bac": "", "specialite": "", @@ -699,8 +710,9 @@ "moy_sae_14_3": "", "moy_sae_15_3": "", "ues_validables": "", - "nbabs": 2, + "nbabs": 0, "nbabsjust": 0, + "part_2": "D\u00e9m.", "code_cursus": "S1", "bac": "", "specialite": "", @@ -758,8 +770,9 @@ "moy_sae_14_3": "", "moy_sae_15_3": "", "ues_validables": "", - "nbabs": 0, + "nbabs": 2, "nbabsjust": 0, + "part_2": "D\u00e9f.", "code_cursus": "S1", "bac": "", "specialite": "", @@ -817,8 +830,9 @@ "moy_sae_14_3": "", "moy_sae_15_3": "", "ues_validables": "", - "nbabs": 1, + "nbabs": 0, "nbabsjust": 0, + "part_2": "D\u00e9m.", "code_cursus": "S1", "bac": "", "specialite": "", @@ -878,6 +892,7 @@ "ues_validables": "", "nbabs": 0, "nbabsjust": 0, + "part_2": "D\u00e9f.", "code_cursus": "S1", "bac": "", "specialite": "", @@ -935,8 +950,9 @@ "moy_sae_14_3": "", "moy_sae_15_3": "", "ues_validables": "", - "nbabs": 0, + "nbabs": 1, "nbabsjust": 0, + "part_2": "D\u00e9m.", "code_cursus": "S1", "bac": "", "specialite": "",