From 862ec88191750d47c7883f00748c6f34dc7c5ac6 Mon Sep 17 00:00:00 2001
From: Pierre-Antoine Rouby <pierre-antoine.rouby@inrae.fr>
Date: Tue, 24 Oct 2023 10:48:54 +0200
Subject: [PATCH] tests: Add test script and fix pep8 in unittest.

---
 src/Model/test_Model.py |  2 ++
 tests.sh                | 19 +++++++++++++++++++
 2 files changed, 21 insertions(+)
 create mode 100755 tests.sh

diff --git a/src/Model/test_Model.py b/src/Model/test_Model.py
index e8577494..2694366f 100644
--- a/src/Model/test_Model.py
+++ b/src/Model/test_Model.py
@@ -24,6 +24,7 @@ from Model.Saved import SavedStatus
 from Model.Study import Study
 from Model.River import River
 
+
 class StudyTestCase(unittest.TestCase):
     def test_create_study(self):
         study = Study.new("foo", "bar")
@@ -57,6 +58,7 @@ class StudyTestCase(unittest.TestCase):
         study = Study.new("foo", "bar")
         self.assertNotEqual(study.river, None)
 
+
 class RiverTestCase(unittest.TestCase):
     def test_create_river(self):
         status = SavedStatus()
diff --git a/tests.sh b/tests.sh
new file mode 100755
index 00000000..2e4df6bc
--- /dev/null
+++ b/tests.sh
@@ -0,0 +1,19 @@
+#! /bin/sh
+
+echo " Setup ENV"
+
+python3 -m venv venv
+. venv/bin/activate
+pip3 install -U pip
+pip3 install -r ./full-requirements.txt
+pip3 install -U -r ./full-requirements.txt
+
+echo " UNITTEST"
+
+cd src/
+python3 -m unittest discover -v -t .
+cd ..
+
+echo " PEP8"
+
+pycodestyle ./src
-- 
GitLab