From 96531f839c066dee68b773eb7a70b4dafe99f527 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Thu, 10 Aug 2023 21:15:42 +0200 Subject: [PATCH] Fix: tests unitaires test_but_jury.py. + check in package building script. --- tests/unit/test_abs_counts.py | 4 ---- tests/unit/yaml_setup_but.py | 5 +++-- tools/build_release.sh | 4 ++-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/tests/unit/test_abs_counts.py b/tests/unit/test_abs_counts.py index 5b0a5f04..9f1147bb 100644 --- a/tests/unit/test_abs_counts.py +++ b/tests/unit/test_abs_counts.py @@ -6,14 +6,10 @@ Comptage des absences """ # test écrit par Fares Amer, mai 2021 et porté sur ScoDoc 8 en juillet 2021 -import json - from tests.unit import sco_fake_gen from app.scodoc import sco_abs, sco_formsemestre from app.scodoc import sco_abs_views -from app.scodoc import sco_groups -from app.views import absences def test_abs_counts(test_client): diff --git a/tests/unit/yaml_setup_but.py b/tests/unit/yaml_setup_but.py index 8412ed2b..d87ca135 100644 --- a/tests/unit/yaml_setup_but.py +++ b/tests/unit/yaml_setup_but.py @@ -134,8 +134,9 @@ def associe_modules_et_parcours(formation: Formation, formation_infos: dict): for module in formation.modules if re.match(code_module, module.code) ]: - module.parcours.append(parcour) - db.session.add(module) + if not parcour in module.parcours: + module.parcours.append(parcour) + db.session.add(module) db.session.commit() diff --git a/tools/build_release.sh b/tools/build_release.sh index 99ab4c89..f7f89828 100755 --- a/tools/build_release.sh +++ b/tools/build_release.sh @@ -59,10 +59,10 @@ SCODOC_USER=scodoc # Tests unitaires lancés dans le répertoire de travail echo "TESTS UNITAIRES" -(cd "$UNIT_TESTS_DIR"; pytest tests/unit) +(cd "$UNIT_TESTS_DIR"; pytest tests/unit) || terminate "Erreur dans tests unitaires" # Tests API -(cd "$UNIT_TESTS_DIR"; tools/test_api.sh) +(cd "$UNIT_TESTS_DIR"; tools/test_api.sh) || terminate "Erreur dans tests unitaires API" # Création répertoire du paquet, et de opt