示例#1
0
def test_win_diagonal():
    board = SplineState("""\
  A C E G
7 W W B . 7

5 W W B B 5

3 W B W B 3

1 . B B W 1
  A C E G
""")
    expected_winner = board.WHITE

    winner = board.get_winner()

    assert winner == expected_winner
示例#2
0
def test_win_column():
    board = SplineState("""\
  A C E G
7 W W B . 7

5 W W B W 5

3 W B B . 3

1 . B B . 1
  A C E G
""")
    expected_winner = board.BLACK

    winner = board.get_winner()

    assert winner == expected_winner
示例#3
0
def test_win_row():
    board = SplineState("""\
  A C E G
7 . . . . 7

5 W W W W 5

3 . B B . 3

1 . B B . 1
  A C E G
""")
    expected_winner = board.WHITE

    winner = board.get_winner()

    assert winner == expected_winner
示例#4
0
def test_win_column_level_2():
    board = SplineState("""\
  A C E G
7 W W W . 7

5 W W B W 5

3 W B B . 3

1 . B B . 1
  A C E G
   B D F
 6 B W . 6

 4 B W B 4

 2 . W . 2
   B D F
""")
    expected_winner = board.WHITE

    winner = board.get_winner()

    assert winner == expected_winner