tests: Add test script and fix pep8 in unittest.

setup.py
Pierre-Antoine Rouby 2023-10-24 10:48:54 +02:00
parent d36a9cd340
commit 862ec88191
2 changed files with 21 additions and 0 deletions

View File

@ -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()

19
tests.sh Executable file
View File

@ -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