def test_check_direction():
    data = '''
........
........
........
...BW...
...WB...
........
........
........
B'''
    board,turn = katareversi.read_board(data[1:])
    assert katareversi.check_direction(board, 2, 4, 'B', True)
def test_check_board_position():
    return
    data = '''
........
........
........
...BW...
...WB...
........
........
........
B'''
    board,turn = katareversi.read_board(data[1:])
    assert katareversi.check_board_position(board, row=2, col=4, turn='B') == True
    assert katareversi.check_board_position(board, row=2, col=4, turn='W') == False
def test_read_board():
    data = '''
........
........
........
...BW...
...WB...
........
........
........
B'''
    board,turn = katareversi.read_board(data[1:])
    assert turn == 'B', 'Wrong turn: '+turn
    assert board.row(3).col(3) == 'B'
    assert board.row(3).col(4) == 'W'
    assert board.row(4).col(3) == 'W'
    assert board.row(4).col(4) == 'B'
    assert board.row(4).col(5) == '.'