X-Git-Url: https://git.ctpug.org.za/?a=blobdiff_plain;f=naja%2Ftests%2Ftest_actions.py;h=02c07964342df9f4d06ee6c7cca4427d49e62edd;hb=adc94b74d51f5e20faac9b98257463eb918585fd;hp=a8d9201206425be0840bbad3a947965c858d8179;hpb=4430c92a3e7c1cd14a5a672c4899ee5406a095fb;p=naja.git diff --git a/naja/tests/test_actions.py b/naja/tests/test_actions.py index a8d9201..02c0796 100644 --- a/naja/tests/test_actions.py +++ b/naja/tests/test_actions.py @@ -129,7 +129,7 @@ class TestActions(TestCase): def test_AcquireWinToken(self): board = self.make_board( - player_bits=[BITS.CYAN, BITS.MAGENTA, BITS.YELLOW, BITS.MSB]) + player_bits=[BITS.CYAN, BITS.MAGENTA, BITS.YELLOW]) state_before = board.export() actions.AcquireWinToken(set()).perform_action(board, None) state_after = board.export() @@ -138,3 +138,29 @@ class TestActions(TestCase): self.assert_state( state_before, state_after, exclude=['wins'], player_exclude=['bits']) + + def test_GainHealthAndClearBitsOrMSB_MSB_clear(self): + board = self.make_board(player_bits=[BITS.NORTH]) + board.lose_health() + state_before = board.export() + card = LocationCard(set([BITS.CYAN, BITS.NORTH]), []) + actions.GainHealthAndClearBitsOrMSB(set()).perform_action(board, card) + state_after = board.export() + self.assertEqual(state_after['health'], state_before['health'] + 1) + self.assert_player_bits(board) + self.assert_state( + state_before, state_after, exclude=['health'], + player_exclude=['bits']) + + def test_GainHealthAndClearBitsOrMSB_MSB_set(self): + board = self.make_board(player_bits=[BITS.MSB, BITS.NORTH]) + board.lose_health() + state_before = board.export() + card = LocationCard(set([BITS.CYAN, BITS.NORTH]), []) + actions.GainHealthAndClearBitsOrMSB(set()).perform_action(board, card) + state_after = board.export() + self.assertEqual(state_after['health'], state_before['health'] + 1) + self.assert_player_bits(board, BITS.NORTH) + self.assert_state( + state_before, state_after, exclude=['health'], + player_exclude=['bits'])