示例#1
0
def test__check_diagonal_right():
    b = Board()
    player = 1
    assert b._check_diagonal_right(player, 0, 2) is False
    assert b._check_diagonal_right(player, 1, 3) is False
    assert b._check_diagonal_right(player, 2, 4) is False
    assert b._check_diagonal_right(player, 3, 5) is False
    assert b.add_disc(player, 0)
    assert b.add_disc(player, 0)
    assert b.add_disc(player, 0)
    assert b.add_disc(player, 1)
    assert b.add_disc(player, 1)
    assert b.add_disc(player, 2)
    player = 2
    assert b.add_disc(player, 3)
    assert b.add_disc(player, 2)
    assert b.add_disc(player, 1)
    assert b.add_disc(player, 0)
    assert b._check_diagonal_right(player, 0, 2)
    assert b._check_diagonal_right(player, 1, 3)
    assert b._check_diagonal_right(player, 2, 4)
    assert b._check_diagonal_right(player, 3, 5)