Beispiel #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
Beispiel #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
Beispiel #3
0
def test_board_get_random_move_check_size():
    b = Board(row_size=4)
    m = b.get_random_move()
    assert len(m) == b.row_size
Beispiel #4
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
Beispiel #5
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
Beispiel #6
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