projects
/
naja.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Draw tile backgrounds
[naja.git]
/
naja
/
tests
/
test_actions.py
diff --git
a/naja/tests/test_actions.py
b/naja/tests/test_actions.py
index 69ed8819ed54c80be1d87e89fe6eef8f931f931b..fb2c370b4cf11662543479a048564c1066a5951d 100644
(file)
--- a/
naja/tests/test_actions.py
+++ b/
naja/tests/test_actions.py
@@
-32,6
+32,10
@@
class TestActions(TestCase):
check_available(set([BITS.MSB]), [], False)
check_available(set([BITS.MSB]), [BITS.MSB], True)
check_available(set([BITS.MSB]), [], False)
check_available(set([BITS.MSB]), [BITS.MSB], True)
+ def test_bits_translation(self):
+ action = actions.LocationAction(set([BITS.NORTH, 'MSB']))
+ self.assertEqual(action.required_bits, set([BITS.NORTH, BITS.MSB]))
+
def test_DoNothing(self):
board = self.make_board()
state_before = board.export()
def test_DoNothing(self):
board = self.make_board()
state_before = board.export()
@@
-42,7
+46,7
@@
class TestActions(TestCase):
def test_LoseHealthOrMSB_MSB_clear(self):
board = self.make_board()
state_before = board.export()
def test_LoseHealthOrMSB_MSB_clear(self):
board = self.make_board()
state_before = board.export()
- actions.LoseHeathOrMSB(set()).perform_action(board, None)
+ actions.LoseHea
l
thOrMSB(set()).perform_action(board, None)
state_after = board.export()
self.assertEqual(state_after['health'], state_before['health'] - 1)
state_after = board.export()
self.assertEqual(state_after['health'], state_before['health'] - 1)
@@
-53,7
+57,7
@@
class TestActions(TestCase):
def test_LoseHealthOrMSB_MSB_set(self):
board = self.make_board(player_bits=[BITS.MSB])
state_before = board.export()
def test_LoseHealthOrMSB_MSB_set(self):
board = self.make_board(player_bits=[BITS.MSB])
state_before = board.export()
- actions.LoseHeathOrMSB(set()).perform_action(board, None)
+ actions.LoseHea
l
thOrMSB(set()).perform_action(board, None)
state_after = board.export()
self.assertEqual(board.player.bits.check_bit(BITS.MSB), False)
state_after = board.export()
self.assertEqual(board.player.bits.check_bit(BITS.MSB), False)