Commit 2f65031c authored by Louis's avatar Louis
Browse files

Ajout d'un test unitaire pour vérifier que les noms des exercices sont uniques (dans chaque niveau)

parent eae136f8
import unittest
import pyromaths
class UniqueName(unittest.TestCase):
def test_uniquename(self):
"""Check that in each level, exercice names are unique"""
levels = pyromaths.ex.load_levels()
for level in levels:
names = []
for exercice in levels[level]:
if issubclass(exercice, pyromaths.ex.LegacyExercise):
names.append(exercice.function[0].__name__)
else:
names.append(exercice.__name__)
self.assertEqual(len(names), len(set(names)))
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment