added more tests for chess moves; they all pass
[naja.git] / naja / tests / test_gameboard.py
index d40873f12e707e78ef04a34e5322564c2812ed28..3bbf59bcf6e21d8cc916e37079c5a19eb04ebdbe 100644 (file)
@@ -1,6 +1,6 @@
 from unittest import TestCase
 
-from naja.constants import BITS
+from naja.constants import BITS, MOVES
 from naja.gameboard import GameBoard, LocationCard
 from naja import actions
 
@@ -124,6 +124,25 @@ class TestGameBoard(TestCase):
             (0, 2): '12', (1, 2): '32', (3, 2): '42', (4, 2): '02',
         }))
 
+    def test_allow_chess_move_knight(self):
+        board = GameBoard.new_game([{'actions': []}])
+        board.board_locations = self.generate_locations()
+        board.allow_chess_move(MOVES.KNIGHT)
+        self.assertEqual(board.player.movement_mode, MOVES.KNIGHT)
+
+    def test_allow_chess_move_bishop(self):
+        board = GameBoard.new_game([{'actions': []}])
+        board.board_locations = self.generate_locations()
+        board.allow_chess_move(MOVES.BISHOP)
+        self.assertEqual(board.player.movement_mode, MOVES.BISHOP)
+
+    def test_allow_chess_move_castle(self):
+        board = GameBoard.new_game([{'actions': []}])
+        board.board_locations = self.generate_locations()
+        board.allow_chess_move(MOVES.CASTLE)
+        self.assertEqual(board.player.movement_mode, MOVES.CASTLE)
+
+
 
 class TestLocationCard(TestCase):
     def test_generate_bitwise_operand(self):