def test_rook_reach():
    rook = Rook(mock_board, 5, 5, WHITE)
    assert rook.can_reach(5, 8)
    assert rook.can_reach(2, 5)
    assert rook.can_reach(7, 5)
    assert not rook.can_reach(6, 6)
    assert not rook.can_reach(4, 3)
예제 #2
0
 def test_blocked_field_moved(self, populated_board):
     rook = Rook(populated_board, 5, 5, WHITE)
     assert not rook.can_reach(1, 5)
     assert not rook.can_reach(5, 8)
     assert not rook.can_reach(8, 5)
     assert not rook.can_reach(5, 2)
예제 #3
0
 def test_occupied_field_move(self, populated_board):
     rook = Rook(populated_board, 5, 5, WHITE)
     assert not rook.can_reach(2, 5)
     assert not rook.can_reach(5, 7)
     assert not rook.can_reach(7, 5)
     assert not rook.can_reach(5, 3)
예제 #4
0
 def test_non_blocked_move(self, populated_board):
     rook = Rook(populated_board, 5, 5, WHITE)
     assert rook.can_reach(3, 5)
     assert rook.can_reach(6, 5)
     assert rook.can_reach(5, 6)
예제 #5
0
 def test_illegal_move(self, empty_board):
     rook = Rook(empty_board, 5, 5, WHITE)
     assert not rook.can_reach(6, 6)
     assert not rook.can_reach(4, 3)
예제 #6
0
 def test_allowed_move(self, empty_board):
     rook = Rook(empty_board, 5, 5, WHITE)
     assert rook.can_reach(5, 8)
     assert rook.can_reach(2, 5)
     assert rook.can_reach(7, 5)