Hong-Phuc Bui
7 days ago c97d23edee3e224f1bcba0add74b61934ad69ff7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
from tictactoe import pruefe_combination, has_spieler_gewonnen, PL1, PL2, EMPTY 
 
 
def test_pruefe_combination_horizontal_hvd():
    test_board = [
        [PL1,   PL1, PL1],
        [EMPTY, PL2, EMPTY],
        [EMPTY, PL2, EMPTY]
    ]
 
    result = pruefe_combination( (0,0,"hvd"), test_board )
    assert result
 
 
def test_pruefe_combination_vertikal_hvd():
    test_board = [
        [PL1, EMPTY, EMPTY],
        [PL1, PL2,   EMPTY],
        [PL1, PL2,   EMPTY]
    ]
 
    result = pruefe_combination( (0,0,"hvd"), test_board )
    assert result
 
 
def test_pruefe_combination_diagonal_hvd():
    test_board = [
        [PL1, EMPTY, EMPTY],
        [PL2, PL1,   EMPTY],
        [PL1, EMPTY, PL1]
    ]
 
    result = pruefe_combination( (0,0,"hvd"), test_board )
    assert result
    
    
def test_pruefe_combination_horizontal_h():
    test_board = [
        [PL1, EMPTY, EMPTY],
        [PL1, PL1,   PL1],
        [PL2, PL1, PL1]
    ]
 
    result = pruefe_combination( (1,0,"h"), test_board )
    assert result