Exemplo n.º 1
0
def test_is_valid_space_out_of_range():
    """Check that a position outside the range of the board array is classified
    as invalid.
    """
    board = Board()

    assert not board.is_valid_space((7, 2))
Exemplo n.º 2
0
def test_is_valid_space_valid():
    """Check that a valid space on a base 4 board isn't misclassified as an
    invalid space.
    """
    board = Board()

    assert board.is_valid_space((3, 3))
Exemplo n.º 3
0
def test_is_valid_space_invalid():
    """Check that all invalid spaces on a base 4 board are correctly identified
    as invalid.
    """
    board = Board()

    invalid_spaces = [(0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (2, 0), (4, 6),
                      (5, 5), (5, 6), (6, 4), (6, 5), (6, 6)]

    for space in invalid_spaces:
        assert not board.is_valid_space(space)