Ajout d'un fichier de test avec pytest
Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
This commit is contained in:
24
main_test.py
Executable file
24
main_test.py
Executable file
@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
"""
|
||||
Exécution des tests du script.
|
||||
"""
|
||||
|
||||
import unittest
|
||||
|
||||
import main
|
||||
|
||||
|
||||
def test_aide():
|
||||
"""
|
||||
On essaie d'afficher l'aide, et on vérifie si ça affiche la bonne chose.
|
||||
"""
|
||||
res = main.commande("aide")
|
||||
lines = res.split("\n")
|
||||
assert len(lines) == 6
|
||||
assert lines[0].startswith("aide")
|
||||
assert lines[1].startswith("seminaire")
|
||||
assert lines[2].startswith("blague")
|
||||
assert lines[3].startswith("calcul")
|
||||
assert lines[4].startswith("tri")
|
||||
assert lines[5].startswith("stop")
|
Reference in New Issue
Block a user