X-Git-Url: https://git.ctpug.org.za/?a=blobdiff_plain;f=naja%2Ftests%2Ftest_actions.py;h=d903648cc626914e96aab9940ae7cbf57441e892;hb=4c5f45d39c034c4fc78de5f5a75e16e6ad918b95;hp=a8d9201206425be0840bbad3a947965c858d8179;hpb=4430c92a3e7c1cd14a5a672c4899ee5406a095fb;p=naja.git diff --git a/naja/tests/test_actions.py b/naja/tests/test_actions.py index a8d9201..d903648 100644 --- a/naja/tests/test_actions.py +++ b/naja/tests/test_actions.py @@ -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'])