-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbyotest.py
60 lines (35 loc) · 1.11 KB
/
byotest.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
import unittest
import run
class TestStringMethods(unittest.TestCase):
#Tests for genarsing game modules:
#1
#def test_write_to_file():
#3
def test_storePlayerName(self):
users = run.storePlayerName()
self.assertGreater(len(users), 0)
#4
def test_loadRiddles(self):
"""
test to check that the users can be loaded from the
json file
"""
riddles = run.loadRiddles()
self.assertEqual(len(riddles), 14)
#5
def test_validateAnswer(self):
"""
test to vslidate the user's answer against our own
from our json file.
"""
riddles = run.loadRiddles()
self.assertEqual(run.validateAnswer(riddles[0], "clock"), True)
self.assertEqual(run.validateAnswer(riddles[0], "house"), False)
def test_count_eq(self):
"""Will succeed"""
self.assertCountEqual(self.result, self.expected)
def test_list_eq(self):
"""Will fail"""
self.assertListEqual(self.result, self.expected)
if __name__ == '__main__':
unittest.main()