-
Notifications
You must be signed in to change notification settings - Fork 0
/
tests.py
112 lines (91 loc) · 3.85 KB
/
tests.py
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
import gpyChess
import unittest
# initial board
def initialBoardTest():
b1 = Board()
b1.piecesFromBoardStrings()
b1.getAllPossibleMoves()
# TODO: generate board strings from pieces / moves
# TODO: rethink data structs
# -----------------------------------------------------------------------------
# TODO: turn the tests below into valid unit tests (use pytest or something)
# -----------------------------------------------------------------------------
# TODO: test rooks possible moves
def emptyRook():
print('emptyRook\n-------------\n')
emptyRook = Board('........\n........\n...r....\n........\n........\n........\n........\n........')
emptyRook.piecesFromBoardStrings()
emptyRook.getAllPossibleMoves()
# TODO: test rook taking opposing piece
def rookPawn():
print('rookPawn\n-------------\n')
rookPawn = Board('........\n........\n...r..p.\n........\n........\n........\n...P....\n........')
rookPawn.piecesFromBoardStrings()
rookPawn.getAllPossibleMoves()
# TODO: test rook taking opposing piece
# TODO: test knights possible moves
def emptyKnight():
print('emptyKnight\n-------------\n')
emptyKnight = Board('........\n........\n...n....\n........\n........\n........\n........\n........')
emptyKnight.piecesFromBoardStrings()
emptyKnight.getAllPossibleMoves()
# TODO: test bishops possible moves
def bishopPawn():
print('bishopPawn\n-------------\n')
bishopPawn = Board('........\n........\n...b..p.\n........\n........\n........\n...P....\n........')
bishopPawn.piecesFromBoardStrings()
bishopPawn.getAllPossibleMoves()
# TODO: test kings possible moves
def emptyKing23():
print('emptyKing\n-------------\n')
emptyKing = Board('........\n........\n...k....\n........\n........\n........\n........\n........')
emptyKing.piecesFromBoardStrings()
emptyKing.getAllPossibleMoves()
# TODO: test kings possible moves on borders
def emptyKingNorthWest():
print('emptyKing NW\n-------------\n')
emptyKing = Board('k.......\n........\n........\n........\n........\n........\n........\n........')
emptyKing.piecesFromBoardStrings()
emptyKing.getAllPossibleMoves()
#
def emptyKingSouthEast():
print('emptyKing SE\n-------------\n')
emptyKing = Board('........\n........\n........\n........\n........\n........\n........\n.......k')
emptyKing.piecesFromBoardStrings()
emptyKing.getAllPossibleMoves()
#
def emptyKingNorthEast():
print('emptyKing NE\n-------------\n')
emptyKing = Board('.......k\n........\n........\n........\n........\n........\n........\n........')
emptyKing.piecesFromBoardStrings()
emptyKing.getAllPossibleMoves()
#
def emptyKingSouthWest():
print('emptyKing SW\n-------------\n')
emptyKing = Board('........\n........\n........\n........\n........\n........\n........\nk.......')
emptyKing.piecesFromBoardStrings()
emptyKing.getAllPossibleMoves()
#
#
def kingPawnOpposing():
print('kingPawn opposing\n-------------\n')
kingPawn = Board('........\n........\n........\n........\n........\n........\n.P......\n.k......')
kingPawn.piecesFromBoardStrings()
kingPawn.getAllPossibleMoves()
def kingPawnFriendly():
print('kingPawn friendly\n-------------\n')
kingPawn = Board('........\n........\n........\n........\n........\n........\n.p......\n.k......')
kingPawn.piecesFromBoardStrings()
kingPawn.getAllPossibleMoves()
# TODO: test queens possible moves
def queenPawn():
print('queenPawn\n-------------\n')
queenPawn = Board('........\n........\n...q..p.\n........\n........\n........\n...P....\n........')
queenPawn.piecesFromBoardStrings()
queenPawn.getAllPossibleMoves()
# TODO: test if move is check
# TODO: test if move is mate
# TODO: test pawn move - should generate new board
# TODO: test pawn captures - should generate new board
# TODO: test queen move
# TODO: test queen captures