示例#1
0
def test_board_is_move_allowed_move_to_big():
    b = Board(max_row=1)
    m = b.get_random_move()
    m.append(b.min_val)
    assert b.is_move_allowed(m) == False
示例#2
0
def test_board_is_move_allowed_board_full():
    b = Board(max_row=1)
    m = b.get_random_move()
    b.play(m)
    assert b.is_move_allowed(m) == False
示例#3
0
def test_board_is_move_allowed_board_full():
    b = Board(max_row=2, row_size=4, min_val=1, solution=[1, 1, 1, 1])
    m = [1, 1, 1, 1]
    b.play(m)
    assert b.is_move_allowed(m) == False
示例#4
0
def test_board_is_move_allowed_move_contain_None_value():
    b = Board(max_row=1, row_size=3)
    m = [None, 1, 1]
    assert b.is_move_allowed(m) == False
示例#5
0
def test_board_is_move_allowed_none_move():
    b = Board(max_row=1)
    m = None
    assert b.is_move_allowed(m) == False
示例#6
0
def test_board_is_move_allowed_move_contain_lower_value():
    b = Board(max_row=1, min_val=1)
    m = b.get_random_move()
    m[0] = b.min_val - 1
    assert b.is_move_allowed(m) == False
示例#7
0
def test_board_is_move_allowed_move_contain_higher_value():
    b = Board(max_row=1, max_val=3)
    m = b.get_random_move()
    m[0] = b.max_val + 1
    assert b.is_move_allowed(m) == False
示例#8
0
def test_board_is_move_allowed_move_to_short():
    b = Board(max_row=1)
    m = b.get_random_move()
    m.pop()
    assert b.is_move_allowed(m) == False