-
Notifications
You must be signed in to change notification settings - Fork 4
/
testsuite.py
67 lines (52 loc) · 1.8 KB
/
testsuite.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
import unittest as ut
from packages.dining.dining import getDiningEvents
from packages.clubs.clubs import find_clubs
class ATest(ut.TestCase):
def anyTest(self):
print("could be any test code here")
def moreTest(self):
print("could be more test code here")
class BTest(ut.TestCase):
def failTest(self):
print("test if something fails")
def runTest(self):
print("can run a few tests here")
class diningTest(ut.TestCase):
def runTest(self):
"""
Test getDiningEvents() function:
if currently there's no dining events on
the dining website, result is an empty list
"""
# ut.TestCase.assertNotEqual(self, getDiningEvents(),
# [], msg="there are no dining events the result is an empty list")
ut.TestCase.assertEqual(
self,
getDiningEvents(),
[],
msg="there are dining events the result is not an empty list")
class clubTest(ut.TestCase):
def runTest(self):
"""
Test find_clubs() function.
Using "ADI" as an input would get a list of length 2
as result since ADI and cheerleading team will be
returned as results
"""
ut.TestCase.assertEqual(self,
len(find_clubs("ADI")),
2,
msg=("There should be two results"
" when the input is 'ADI' "))
def suite():
suite = ut.TestSuite()
suite.addTest(ATest("anyTest"))
suite.addTest(ATest("moreTest"))
suite.addTest(BTest("failTest"))
suite.addTest(BTest())
suite.addTest(diningTest())
suite.addTest(clubTest())
return suite
if __name__ == '__main__':
runner = ut.TextTestRunner()
runner.run(suite())