Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
Menteur
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PLN
Menteur
Commits
11dc9ff8
Unverified
Commit
11dc9ff8
authored
Apr 04, 2020
by
PLN (Algolia)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: Test_turn
parent
03a91eb2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
test_game.py
test/test_game.py
+30
-0
No files found.
test/test_game.py
View file @
11dc9ff8
from
unittest
import
TestCase
from
model.data
import
Game
,
Player
class
TestGame
(
TestCase
):
def
setUp
(
self
)
->
None
:
super
()
.
setUp
()
self
.
player1
=
Player
(
name
=
""
)
self
.
player2
=
Player
()
self
.
game
=
Game
([
self
.
player1
,
self
.
player2
])
def
test_global_hand
(
self
)
->
None
:
card1
=
self
.
game
.
deck
.
random_card
()
self
.
player1
.
give
(
card1
)
card2
=
self
.
game
.
deck
.
random_card
()
card3
=
self
.
game
.
deck
.
random_card
()
self
.
player2
.
give
(
card2
)
self
.
player2
.
give
(
card3
)
self
.
assertTrue
(
card1
in
self
.
game
.
global_hand
,
"Global hand should contain player1's card"
)
self
.
assertTrue
(
card2
in
self
.
game
.
global_hand
,
"Global hand should contain player2's first card"
)
self
.
assertTrue
(
card3
in
self
.
game
.
global_hand
,
"Global hand should contain player2's second card"
)
def
test_turn
(
self
):
self
.
game
.
new_turn
()
self
.
assertEqual
(
1
,
len
(
self
.
game
.
defeats
.
values
()),
"There should have been one defeat."
)
self
.
assertTrue
(
1
in
self
.
game
.
defeats
.
values
(),
"A player should have one defeat."
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment