diff options
author | Marianne Chevrot <blackmoor+git@devys.org> | 2020-05-16 22:16:55 +0200 |
---|---|---|
committer | Marianne Chevrot <blackmoor+git@devys.org> | 2020-05-16 22:16:55 +0200 |
commit | a737d24d4c2ae75756c25859be294aa71ad98418 (patch) | |
tree | 97124e95a1c9f7070128923aebc1b5b2cc0c6fd4 /tests_solver | |
parent | d414a6baf804bd188fbccf94f381c6a29c600ae0 (diff) | |
download | kana_quest_solver-a737d24d4c2ae75756c25859be294aa71ad98418.tar.gz kana_quest_solver-a737d24d4c2ae75756c25859be294aa71ad98418.tar.bz2 kana_quest_solver-a737d24d4c2ae75756c25859be294aa71ad98418.zip |
Add slim infested unit test
Diffstat (limited to 'tests_solver')
-rw-r--r-- | tests_solver/test_solver.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tests_solver/test_solver.py b/tests_solver/test_solver.py index 2ddc152..1f178cc 100644 --- a/tests_solver/test_solver.py +++ b/tests_solver/test_solver.py @@ -34,7 +34,7 @@ def test_is_swappable(): assert not kanagrid.is_swappable((0, 0), (1, 0)) -def test_reveal_myst(): +def test_action_reveal(): kanagrid_orig = KanaGrid((1, 1), [Kana("myst", "ko")]) kanagrid_new = kanagrid_orig.action(pos=(0, 0), action_type="reveal") @@ -43,6 +43,18 @@ def test_reveal_myst(): assert kanagrid_new == expected_grid +def test_action_slime_infest(): + + kanagrid_orig = KanaGrid((2, 1), [Kana("norm", "ko"), Kana("slim", "e")]) + kanagrid_new_1 = kanagrid_orig.action(pos=(1, 0), action_type="left") + kanagrid_new_2 = kanagrid_orig.action(pos=(0, 0), action_type="right") + expected_grid = KanaGrid((2, 1), [Kana("norm", "ke"), Kana("void")], action_count=1) + + assert kanagrid_new_1 == expected_grid + # Move of slime only is implemented, not other to slime + assert kanagrid_new_2 == None + + def test_kana_grid(): initial_grid = [ |