2021-01-26 16:07:12 +00:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
|
|
|
"""
|
|
|
|
Exécution des tests du script.
|
|
|
|
"""
|
|
|
|
|
2021-01-26 17:37:12 +00:00
|
|
|
import unittest
|
|
|
|
|
2021-01-26 16:07:12 +00:00
|
|
|
import main
|
|
|
|
|
|
|
|
|
2021-01-26 17:37:12 +00:00
|
|
|
class TestMain(unittest.TestCase):
|
2021-01-26 16:07:12 +00:00
|
|
|
"""
|
2021-01-26 17:37:12 +00:00
|
|
|
Cette classe permet d'executer l'ensemble des scripts
|
2021-01-26 16:07:12 +00:00
|
|
|
"""
|
2021-01-26 17:37:12 +00:00
|
|
|
|
|
|
|
def test_aide(self):
|
|
|
|
"""
|
|
|
|
On essaie d'afficher l'aide, et on vérifie si ça affiche la bonne chose.
|
|
|
|
"""
|
|
|
|
res = main.commande("aide")
|
|
|
|
lines = res.split("\n")
|
|
|
|
self.assertEqual(len(lines), 6)
|
|
|
|
self.assertTrue(lines[0].startswith("aide"))
|
|
|
|
self.assertTrue(lines[1].startswith("seminaire"))
|
|
|
|
self.assertTrue(lines[2].startswith("blague"))
|
|
|
|
self.assertTrue(lines[3].startswith("calcul"))
|
|
|
|
self.assertTrue(lines[4].startswith("tri"))
|
|
|
|
self.assertTrue(lines[5].startswith("stop"))
|