-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
executable file
·48 lines (32 loc) · 959 Bytes
/
test.py
File metadata and controls
executable file
·48 lines (32 loc) · 959 Bytes
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
#!/usr/bin/python
import unittest
from view import View
from controller import Controller
from model import Model
import mocks
class TestView(unittest.TestCase):
def setUp(self):
self.view = View()
self.view.setController(mocks.MockController())
def test_do_foo(self):
self.view.do_foo([])
self.assertEqual(1, 1)
class TestController(unittest.TestCase):
def setUp(self):
self.controller = Controller()
self.controller.setModel(mocks.MockModel())
def test_foo(self):
self.controller.foo([])
self.assertEqual(1, 1)
def test_state(self):
self.controller.set('arr')
val = self.controller.get()
self.assertEqual(val, 'arr')
class TestModel(unittest.TestCase):
def setUp(self):
self.model = Model()
def test_foo(self):
self.model.foo([])
self.assertEqual(1, 1)
if __name__ == '__main__':
unittest.main()