forked from stav/choice-parser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
unittest_data.py
84 lines (62 loc) · 2.69 KB
/
unittest_data.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
80
81
82
83
84
import unittest
from choice.router import Router
class TestChoiceData(unittest.TestCase):
def setUp(self):
self.router = Router()
def tearDown(self):
self.router = None
def test_anarchy(self):
self.router.load(['-i', 'input/anarchy'])
self.assertEqual(len(self.router.questions), 10)
def test_drivers(self):
self.router.load(['-i', 'input/drivers'])
self.assertEqual(len(self.router.questions), 11)
def test_reading(self):
self.router.load(['-i', 'input/reading'])
self.assertEqual(len(self.router.questions), 15)
def test_writing(self):
self.router.load(['-i', 'input/writing'])
self.assertEqual(len(self.router.questions), 10)
def test_choices(self):
self.router.load('-i input/choices -m BooleanoptionMogrifyer,SplitstemMogrifyer'.split())
self.assertEqual(len(self.router.questions), 7)
def test_teachers(self):
self.router.load(['-i', 'input/teachers.pdf'])
self.assertEqual(len(self.router.questions), 14)
def test_victoria(self):
self.router.load(['-i', 'input/victoria'])
self.assertEqual(len(self.router.questions), 10)
def test_computer(self):
self.router.load(['-i', 'input/computer.pdf'])
self.assertEqual(len(self.router.questions), 20)
# def test_imhotep(self):
# self.router.load('-i input/imhotep -m SplitstemMogrifyer'.split())
# self.assertEqual(len(self.router.questions), 11)
def test_motorcycle(self):
self.router.load(['-i', 'input/motorcycle'])
self.assertEqual(len(self.router.questions), 10)
def test_vocabulary(self):
self.router.load(['-i', 'input/vocabulary.pdf'])
self.assertEqual(len(self.router.questions), 6)
def test_pharmacology(self):
self.router.load('-i input/pharmacology.pdf'.split())
self.assertTrue(len(self.router.questions) > 250)
def test_regulation(self):
self.router.load(['-i', 'input/regulation.pdf'])
self.assertEqual(len(self.router.questions), 20)
# def test_accounting(self):
# self.router.load(['-i', 'input/accounting.txt'])
# self.assertTrue(len(self.router.questions) > 300)
def test_plants(self):
self.router.load(['-i', 'input/plants.pdf'])
# 56 questions minus 5 short answer
self.assertEqual(len(self.router.questions), 51)
def test_money(self):
self.router.load(['-i', 'input/money.pdf'])
self.assertEqual(len(self.router.questions), 23)
def suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestChoiceData))
return suite
if __name__ == '__main__':
unittest.main()