5 class TestExample(unittest
.TestCase
):
8 self
.app
= wx
.PySimpleApp()
9 self
.frame
= modelExample
.ModelExample(parent
=None, id=-1)
15 self
.frame
.OnBarney(None)
16 self
.assertEqual("Barney", self
.frame
.model
.first
,
18 self
.assertEqual("Rubble", self
.frame
.model
.last
)
21 panel
= self
.frame
.GetChildren()[0]
22 for each
in panel
.GetChildren():
23 if each
.GetLabel() == "Wilmafy":
26 event
= wx
.CommandEvent(wx
.wxEVT_COMMAND_BUTTON_CLICKED
, wilma
.GetId())
27 wilma
.GetEventHandler().ProcessEvent(event
)
28 self
.assertEqual("Wilma", self
.frame
.model
.first
)
29 self
.assertEqual("Flintstone", self
.frame
.model
.last
)
32 suite
= unittest
.makeSuite(TestExample
, 'test')
35 if __name__
== '__main__':
36 unittest
.main(defaultTest
='suite')