-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_module.py
38 lines (30 loc) · 1.17 KB
/
test_module.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
import unittest
from RPS_game import play, mrugesh, abbey, quincy, kris
from RPS import player
class UnitTests(unittest.TestCase):
print()
def test_player_vs_quincy(self):
print("Testing game against quincy...")
actual = play(player, quincy, 1000) >= 60
self.assertTrue(
actual,
'Expected player to defeat quincy at least 60% of the time.')
def test_player_vs_abbey(self):
print("Testing game against abbey...")
actual = play(player, abbey, 1000) >= 60
self.assertTrue(
actual,
'Expected player to defeat abbey at least 60% of the time.')
def test_player_vs_kris(self):
print("Testing game against kris...")
actual = play(player, kris, 1000) >= 60
self.assertTrue(
actual, 'Expected player to defeat kris at least 60% of the time.')
def test_player_vs_mrugesh(self):
print("Testing game against mrugesh...")
actual = play(player, mrugesh, 1000) >= 60
self.assertTrue(
actual,
'Expected player to defeat mrugesh at least 60% of the time.')
if __name__ == "__main__":
unittest.main()