]>
Commit | Line | Data |
---|---|---|
1 | import unittest | |
2 | import modelExample | |
3 | import wx | |
4 | ||
5 | class TestExample(unittest.TestCase): | |
6 | ||
7 | def setUp(self): | |
8 | self.app = wx.PySimpleApp() | |
9 | self.frame = modelExample.ModelExample(parent=None, id=-1) | |
10 | ||
11 | def tearDown(self): | |
12 | self.frame.Destroy() | |
13 | ||
14 | def testModel(self): | |
15 | self.frame.OnBarney(None) | |
16 | self.assertEqual("Barney", self.frame.model.first, | |
17 | msg="First is wrong") | |
18 | self.assertEqual("Rubble", self.frame.model.last) | |
19 | ||
20 | def suite(): | |
21 | suite = unittest.makeSuite(TestExample, 'test') | |
22 | return suite | |
23 | ||
24 | if __name__ == '__main__': | |
25 | unittest.main(defaultTest='suite') | |
26 |