Réparation du tri
Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
This commit is contained in:
parent
e8fc6d0816
commit
db413e4a35
2
main.py
2
main.py
|
@ -106,7 +106,7 @@ def tri(*args):
|
|||
"""
|
||||
Trie les éléments donnés en argument.
|
||||
"""
|
||||
return sorted(args)
|
||||
return sorted(int(number) for number in args)
|
||||
|
||||
|
||||
def stop(exit_code: int = 0):
|
||||
|
|
|
@ -77,9 +77,9 @@ class TestMain(unittest.TestCase):
|
|||
À partir d'une liste donnée, on trie la liste
|
||||
et on vérifie qu'elle est bien triée.
|
||||
"""
|
||||
my_list = [23, 16, 234567, -4]
|
||||
my_list = ["23", "16", "234567", "-4"]
|
||||
shuffle(my_list)
|
||||
sorted_list = sorted(my_list)
|
||||
sorted_list = [-4, 16, 23, 234567]
|
||||
self.assertEqual(main.commande("tri", *my_list), sorted_list)
|
||||
|
||||
def test_stop(self):
|
||||
|
|
Loading…
Reference in New Issue