From db413e4a35b1a1d1230118ddd49910b08d2ef052 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Thu, 28 Jan 2021 14:50:37 +0100 Subject: [PATCH] =?UTF-8?q?R=C3=A9paration=20du=20tri?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yohann D'ANELLO --- main.py | 2 +- main_test.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 14d7902..dbe36d0 100755 --- a/main.py +++ b/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): diff --git a/main_test.py b/main_test.py index 24b895c..6291d5c 100755 --- a/main_test.py +++ b/main_test.py @@ -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):