feat(curriculum): probability calculator test - allow for hat content to be returned in any order (#56504)

This commit is contained in:
Ilenia
2024-10-07 09:34:16 +02:00
committed by GitHub
parent 1d68379159
commit ae3dad2dc0

View File

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