Réparation du tri

Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
This commit is contained in:
Yohann D'ANELLO 2021-01-28 14:50:37 +01:00
parent e8fc6d0816
commit db413e4a35
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
2 changed files with 3 additions and 3 deletions

View File

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

View File

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