def test_shortest_path(self): maps = { 'maps/u.txt': 27, 'maps/ring.txt': 15, 'maps/huge-room.txt': 93, 'maps/empty-room.txt': 23, 'maps/test-board.txt': 4 } for m in maps: board = tronutils.read_board(m) path = MyTronBot.shortest_path(board, board.me(), board.them()) expected = maps[m] actual = MyTronBot.moves_between(path) self.assertEquals(actual, expected)
def test_shortest_path(self): maps = { 'maps/u.txt': 27, 'maps/ring.txt': 15, 'maps/huge-room.txt': 93, 'maps/empty-room.txt': 23, 'maps/test-board.txt': 4 } for m in maps: board = tronutils.read_board(m) path = MyTronBot.shortest_path(board, board.me(), board.them()) expected = maps[m] actual = MyTronBot.moves_between(path) self.assertEquals(actual, expected)