diff options
author | Eddy Pedroni <epedroni@pm.me> | 2024-09-24 17:57:01 +0200 |
---|---|---|
committer | Eddy Pedroni <epedroni@pm.me> | 2024-09-24 17:57:01 +0200 |
commit | fe36d1261dc96004e4d4e692a65e1bc53137726b (patch) | |
tree | ffc2ea48360a44de83bf21dc79231dccbe31d468 /src/scheduler_brutal_unittest.py | |
parent | b3ba811610bf1a6ded287d8fe6df757508d01fa4 (diff) |
Implement brutal scheduler
Diffstat (limited to 'src/scheduler_brutal_unittest.py')
-rw-r--r-- | src/scheduler_brutal_unittest.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/scheduler_brutal_unittest.py b/src/scheduler_brutal_unittest.py index adfb417..779d2c3 100644 --- a/src/scheduler_brutal_unittest.py +++ b/src/scheduler_brutal_unittest.py @@ -7,6 +7,32 @@ from card import Card scheduler_brutal.HISTORY_DEPTH = 3 #-------------------------------------------------------------------------- +# Scheduling behaviour +#-------------------------------------------------------------------------- +def test_scheduling(): + cards = {id: Card("", "") for id in range(0, 10)} + state = { + 0: [1, 1, 1], + 1: [0, 0, 0], + 2: [0, 0, 1], + 3: [1, 0, 0], + + 4: [None, None, 1 ], + 5: [None, 1, None], + 6: [1, None, None], + 7: [None, None, 0 ], + 8: [0, 0, None], + 9: [None, None, None], + } + + expected_priority = [9, 6, 5, 7, 8, 4, 1, 3, 2, 0] + + uut = UUT(cards, state) + + for i in range(0, len(expected_priority)): + assert set(uut.practice(i + 1)) == set(expected_priority[0:i + 1]) + +#-------------------------------------------------------------------------- # State update #-------------------------------------------------------------------------- def test_stateUpdate(): |