From a737d24d4c2ae75756c25859be294aa71ad98418 Mon Sep 17 00:00:00 2001 From: Marianne Chevrot Date: Sat, 16 May 2020 22:16:55 +0200 Subject: Add slim infested unit test --- .coverage | 2 +- tests_solver/test_solver.py | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.coverage b/.coverage index 661bb78..f5776d2 100644 --- a/.coverage +++ b/.coverage @@ -1 +1 @@ -!coverage.py: This is a private format, don't read it directly!{"lines":{"/home/storage/Games/kana_quest/kana_quest_solver/solver.py":[5,17,18,20,21,23,25,27,29,45,48,51,30,31,35,38,54,56,58,69,79,108,143,150,173,192,195,204,212,219,246,255,258,265,274,308,312,320,329,339,347,357,388,39,42,43,61,62,63,64,65,66,67,46,80,205,207,210,81,83,84,85,86,87,88,82,90,91,93,94,95,96,92,98,99,100,105,106,109,110,111,112,70,71,72,73,74,75,76,113,114,213,215,217,115,267,268,269,49,270,266,116,118,119,120,121,117,123,124,137,138,139,140,220,222,228,229,230,231,233,236,237,239,242,243,244,141,259,193,174,175,176,177,178,144,145,146,147,148,179,181,182,151,152,154,155,156,157,159,160,161,162,158,164,165,167,208,168,171,183,184,185,186,187,188,169,313,315,317,206,316,170,166,180,189,261,262,276,277,278,279,280,281,282,283,284,275,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,304,305,260,309,101,102,103,240,104]}} \ No newline at end of file +!coverage.py: This is a private format, don't read it directly!{"lines":{"/home/storage/Games/kana_quest/kana_quest_solver/solver.py":[5,17,18,20,21,23,25,27,29,45,48,51,30,31,35,38,54,56,58,69,79,108,143,150,173,192,195,204,212,219,246,255,258,265,274,308,312,320,329,339,347,357,388,39,42,43,61,62,63,64,65,66,67,46,80,205,207,210,81,83,84,85,86,87,88,82,90,91,93,94,95,96,92,98,99,100,105,106,109,110,111,112,70,71,72,73,74,75,76,113,114,213,215,217,115,267,268,269,49,270,266,40,116,118,119,120,121,117,123,124,125,126,127,128,129,130,131,132,134,135,136,137,138,139,140,220,222,228,229,230,231,233,236,237,239,242,243,244,141,259,193,174,175,176,177,178,144,145,146,147,148,179,181,182,151,152,154,155,156,157,159,160,161,162,158,164,165,167,208,168,171,183,184,185,186,187,188,169,313,315,317,206,316,170,166,180,189,261,262,276,277,278,279,280,281,282,283,284,275,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,304,305,260,309,101,102,103,240,104]}} \ No newline at end of file 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 = [ -- cgit v1.2.3