From ae3dad2dc0502a549bfc0347250b81d6867d303d Mon Sep 17 00:00:00 2001 From: Ilenia <26656284+ilenia-magoni@users.noreply.github.com> Date: Mon, 7 Oct 2024 09:34:16 +0200 Subject: [PATCH] feat(curriculum): probability calculator test - allow for hat content to be returned in any order (#56504) --- .../probability-calculator.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/curriculum/challenges/english/07-scientific-computing-with-python/build-a-probability-calculator-project/probability-calculator.md b/curriculum/challenges/english/07-scientific-computing-with-python/build-a-probability-calculator-project/probability-calculator.md index c644bb2c7c5..8b379b6bb41 100644 --- a/curriculum/challenges/english/07-scientific-computing-with-python/build-a-probability-calculator-project/probability-calculator.md +++ b/curriculum/challenges/english/07-scientific-computing-with-python/build-a-probability-calculator-project/probability-calculator.md @@ -164,8 +164,8 @@ class UnitTests(unittest.TestCase): maxDiff = None def test_hat_draw_2(self): hat = probability_calculator.Hat(yellow=5,red=1,green=3,blue=9,test=1) - actual = hat.draw(20) - expected = ['yellow', 'yellow', 'yellow', 'yellow', 'yellow', 'red', 'green', 'green', 'green', 'blue', 'blue', 'blue', 'blue', 'blue', 'blue', 'blue', 'blue', 'blue', 'test'] + actual = sorted(hat.draw(20)) + expected = sorted(['yellow', 'yellow', 'yellow', 'yellow', 'yellow', 'red', 'green', 'green', 'green', 'blue', 'blue', 'blue', 'blue', 'blue', 'blue', 'blue', 'blue', 'blue', 'test']) self.assertEqual(actual, expected, 'Expected hat draw to return all items from hat contents.') actual = len(hat.contents) expected = 0