# Path: tests/helpers.py
# class StubBoard(object):
#     def __init__(self):
#         self._cells = [[None for j in xrange(8)] for i in xrange(8)]
#         self.enpassant = None
# 
#     def __getitem__(self, pos):
#         row, col = pos
#         return self._cells[row][col]
# 
#     def __setitem__(self, pos, piece):
#         row, col = pos
#         self._cells[row][col] = piece
# 
#     def is_empty(self, pos):
#         return self[pos] is None
# 
#     def is_enpassant(self, pos):
#         enp = self.enpassant
#         return enp and enp[0] == pos[0] and enp[1] == pos[1]
# 
# class StubPiece(object):
#     def __init__(self, board, team, position):
#         self.board = board
#         self.team = team
#         self.position = position
# 
# def C(pos):
#     row = int(pos[1]) - 1
#     col = POS[pos[0]]
#     return row, col
# 
# WHITE = 1
# 
# BLACK = -1


import unittest
from .helpers import StubBoard, StubPiece, C, WHITE, BLACK
        from chess.models import Queen

    def test_generate_horizontal_left(self):
        board = StubBoard()
        board[C('g4')] = StubPiece(board, BLACK, None)
        board[C('e7')] = StubPiece(board, WHITE, None)
        board[C('a4')] = StubPiece(board, BLACK, None)
        board[C('e1')] = StubPiece(board, BLACK, None)

        queen = self.get_queen(board, WHITE, C('e4'))
        results = queen.generate()
        expected = [C('d4'), C('c4'), C('b4'), C('a4')]

        correct = self.compare_list(expected, results)
        self.assertTrue(all(correct))

    def test_generate_vertical_top(self):
        board = StubBoard()
        board[C('g4')] = StubPiece(board, BLACK, None)
        board[C('e7')] = StubPiece(board, WHITE, None)
        board[C('a4')] = StubPiece(board, WHITE, None)
        board[C('e1')] = StubPiece(board, BLACK, None)

        queen = self.get_queen(board, WHITE, C('e4'))
        results = queen.generate()
        expected = [C('e5'), C('e6')]

        correct = self.compare_list(expected, results)
        self.assertTrue(all(correct))

    def test_generate_vertical_bottom(self):

# Path: tests/helpers.py
# class StubBoard(object):
#     def __init__(self):
#         self._cells = [[None for j in xrange(8)] for i in xrange(8)]
#         self.enpassant = None
# 
#     def __getitem__(self, pos):
#         row, col = pos
#         return self._cells[row][col]
# 
#     def __setitem__(self, pos, piece):
#         row, col = pos
#         self._cells[row][col] = piece
# 
#     def is_empty(self, pos):
#         return self[pos] is None
# 
#     def is_enpassant(self, pos):
#         enp = self.enpassant
#         return enp and enp[0] == pos[0] and enp[1] == pos[1]
# 
# class StubPiece(object):
#     def __init__(self, board, team, position):
#         self.board = board
#         self.team = team
#         self.position = position
# 
# def C(pos):
#     row = int(pos[1]) - 1
#     col = POS[pos[0]]
#     return row, col
# 
# WHITE = 1
# 
# BLACK = -1


# Path: tests/test_queen_generate.py
import unittest
from .helpers import StubBoard, StubPiece, C, WHITE, BLACK
        from chess.models import Queen


    def test_generate_horizontal_left(self):
        board = StubBoard()
        board[C('g4')] = StubPiece(board, BLACK, None)
        board[C('e7')] = StubPiece(board, WHITE, None)
        board[C('a4')] = StubPiece(board, BLACK, None)
        board[C('e1')] = StubPiece(board, BLACK, None)

        queen = self.get_queen(board, WHITE, C('e4'))
        results = queen.generate()
        expected = [C('d4'), C('c4'), C('b4'), C('a4')]

        correct = self.compare_list(expected, results)
        self.assertTrue(all(correct))

    def test_generate_vertical_top(self):
        board = StubBoard()
        board[C('g4')] = StubPiece(board, BLACK, None)
        board[C('e7')] = StubPiece(board, WHITE, None)
        board[C('a4')] = StubPiece(board, WHITE, None)
        board[C('e1')] = StubPiece(board, BLACK, None)

        queen = self.get_queen(board, WHITE, C('e4'))
        results = queen.generate()
        expected = [C('e5'), C('e6')]

        correct = self.compare_list(expected, results)
        self.assertTrue(all(correct))

    def test_generate_vertical_bottom(self):

        board = StubBoard()