mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-03-04 08:05:48 -05:00
feat(curriculum): probability calculator test - allow for hat content to be returned in any order (#56504)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user