示例#1
0
def test_get_column_exist():
    """ Check there is zero match 
    """

    array = [[0, 1, 1, 0, 1, 1, 0], [0, 1, 1, 0, 1, 1,
                                     0], [0, 1, 1, 0, 1, 1, 0],
             [0, 1, 1, 0, 1, 1, 0], [1, 1, 1, 0, 1, 1, 0],
             [1, 1, 1, 1, 1, 1, 0]]
    board = Board()
    board.board = array
    col_0 = [0, 0, 0, 0, 1, 1]
    col_1 = [1, 1, 1, 1, 1, 1]
    col_2 = [1, 1, 1, 1, 1, 1]
    col_3 = [0, 0, 0, 0, 0, 1]
    col_4 = [1, 1, 1, 1, 1, 1]
    col_5 = [1, 1, 1, 1, 1, 1]
    col_6 = [0, 0, 0, 0, 0, 0]

    assert (board.get_column(0) == col_0)
    assert (board.get_column(1) == col_1)
    assert (board.get_column(2) == col_2)
    assert (board.get_column(3) == col_3)
    assert (board.get_column(4) == col_4)
    assert (board.get_column(5) == col_5)
    assert (board.get_column(6) == col_6)
示例#2
0
def test_get_column_not_exist():
    """ Check there is zero match 
    """
    array = [[0, 1, 1, 0, 1, 1, 0], [0, 1, 1, 0, 1, 1,
                                     0], [0, 1, 1, 0, 1, 1, 0],
             [0, 1, 1, 0, 1, 1, 0], [1, 1, 1, 0, 1, 1, 0],
             [1, 1, 1, 1, 1, 1, 0]]
    board = Board()
    board.board = array
    col_7 = []
    col_8 = []
    col_20 = []

    assert (board.get_column(7) == col_7)
    assert (board.get_column(8) == col_8)
    assert (board.get_column(20) == col_20)