-
Notifications
You must be signed in to change notification settings - Fork 4
/
test_Game.py
79 lines (67 loc) · 2.38 KB
/
test_Game.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
import pytest
from Data.GAME_LOGIC.uno_PlayerList import PlayerList
from Data.GAME_LOGIC.uno_Player import Player
from Data.GAME_LOGIC.unoCore import Game
from Data.GAME_LOGIC.uno_Const import * # const
@pytest.fixture
def game():
p1 = Player('', True)
p2 = Player('', False)
g = Game([p1, p2],MODE_NORMAL)
return g
@pytest.fixture
def game_M():
p1 = Player('', True, 100)
p2 = Player('', True, 1000)
g = Game([p1, p2],MODE_NORMAL)
return g
def test_actList(game):
game.playerList.nextTurn()
assert game.actList()['drawBtn'] == True
assert game.actList()['unoBtn'] == False
assert game.actList()['colorBtn'] == False
game.state = UNO
assert game.actList()['drawBtn'] == True
assert game.actList()['unoBtn'] == True
assert game.actList()['colorBtn'] == False
game.state = NORM
game.playerList.nextTurn()
assert game.actList()['drawBtn'] == False
assert game.actList()['unoBtn'] == False
assert game.actList()['colorBtn'] == False
game.state = UNO
assert game.actList()['drawBtn'] == False
assert game.actList()['unoBtn'] == True
assert game.actList()['colorBtn'] == False
game.state = NORM
game.is_effctTime = True
game.is_selectColor = True
assert game.actList()['drawBtn'] == False
assert game.actList()['unoBtn'] == False
assert game.actList()['colorBtn'] == True
'''
def test_actList_M(game):
game.playerList.nextTurn()
assert game.actList()['drawBtn'] == True
assert game.actList()['unoBtn'] == False
assert game.actList()['colorBtn'] == False
game.state = UNO
assert game.actList()['drawBtn'] == True
assert game.actList()['unoBtn'] == True
assert game.actList()['colorBtn'] == False
game.state = NORM
game.playerList.nextTurn()
assert game.actList()['drawBtn'] == False
assert game.actList()['unoBtn'] == False
assert game.actList()['colorBtn'] == False
game.state = UNO
assert game.actList()['drawBtn'] == False
assert game.actList()['unoBtn'] == True
assert game.actList()['colorBtn'] == False
game.state = NORM
game.is_effctTime = True
game.is_selectColor = True
assert game.actList()['drawBtn'] == False
assert game.actList()['unoBtn'] == False
assert game.actList()['colorBtn'] == True
'''