|
@@ 122-131 (lines=10) @@
|
| 119 |
|
ends = ends_on_enemy(self.chess_board, start, None, potential_end_locations, Mock()) |
| 120 |
|
assert ends == [] |
| 121 |
|
|
| 122 |
|
def test_ends_on_enemy_players_piece(self): |
| 123 |
|
start = (0, 0) |
| 124 |
|
self.chess_board[start] = Mock(color=1) |
| 125 |
|
potential_end_locations = [(1, 0), (2, 0), (2, 2)] |
| 126 |
|
end = None |
| 127 |
|
for end in potential_end_locations: |
| 128 |
|
self.chess_board[end] = Mock(color=1) |
| 129 |
|
self.chess_board[end] = Mock(color=2) |
| 130 |
|
ends = ends_on_enemy(self.chess_board, start, None, potential_end_locations, Mock()) |
| 131 |
|
assert ends == [(2, 2)] |
| 132 |
|
|
| 133 |
|
def test_doesnt_land_on_piece(self): |
| 134 |
|
start = (1, 1) |
|
@@ 113-120 (lines=8) @@
|
| 110 |
|
ends = ends_on_enemy(self.chess_board, start, None, potential_end_locations, Mock()) |
| 111 |
|
assert ends == [] |
| 112 |
|
|
| 113 |
|
def test_ends_on_same_players_piece(self): |
| 114 |
|
start = (0, 0) |
| 115 |
|
self.chess_board[start] = Mock(color=1) |
| 116 |
|
potential_end_locations = [(1, 0), (2, 0), (2, 2)] |
| 117 |
|
for end in potential_end_locations: |
| 118 |
|
self.chess_board[end] = Mock(color=1) |
| 119 |
|
ends = ends_on_enemy(self.chess_board, start, None, potential_end_locations, Mock()) |
| 120 |
|
assert ends == [] |
| 121 |
|
|
| 122 |
|
def test_ends_on_enemy_players_piece(self): |
| 123 |
|
start = (0, 0) |