Add tests for wx.Notebook and wx.Panel

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@69508 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2011-10-22 02:30:11 +00:00
parent 0a753ead2d
commit c14d84f3ee
3 changed files with 72 additions and 1 deletions

View File

@@ -30,11 +30,14 @@ def run():
# Tweak the parsed meta objects in the module object as needed for
# customizing the generated code and docstrings.
module.addHeaderCode('#include <wx/notebook.h>')
c = module.find('wxNotebook')
c.find('OnSelChange').ignore()
tools.fixWindowClass(c)
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)

View File

@@ -0,0 +1,47 @@
import imp_unittest, unittest
import wtc
import wx
#---------------------------------------------------------------------------
class notebook_Tests(wtc.WidgetTestCase):
def test_notebookCtor(self):
nb = wx.Notebook(self.frame)
def test_notebookDefaultCtor(self):
nb = wx.Notebook()
nb.Create(self.frame)
def test_notebookStyles(self):
wx.NB_DEFAULT
wx.NB_TOP
wx.NB_BOTTOM
wx.NB_LEFT
wx.NB_RIGHT
wx.NB_FIXEDWIDTH
wx.NB_MULTILINE
wx.NB_NOPAGETHEME
wx.NB_FLAT
wx.NB_HITTEST_NOWHERE
wx.NB_HITTEST_ONICON
wx.NB_HITTEST_ONLABEL
wx.NB_HITTEST_ONITEM
wx.NB_HITTEST_ONPAGE
def test_notebookPages(self):
nb = wx.Notebook(self.frame, style=wx.NB_BOTTOM)
p1 = wx.Panel(nb)
nb.AddPage(p1, "Page1")
p2 = wx.Panel(nb)
nb.AddPage(p2, "Page2")
nb.SetSelection(0)
#---------------------------------------------------------------------------
if __name__ == '__main__':
unittest.main()

21
unittests/test_panel.py Normal file
View File

@@ -0,0 +1,21 @@
import imp_unittest, unittest
import wtc
import wx
#---------------------------------------------------------------------------
class panel_Tests(wtc.WidgetTestCase):
def test_panelCtor(self):
p = wx.Panel(self.frame)
def test_panelDefaultCtor(self):
p = wx.Panel()
p.Create(self.frame)
#---------------------------------------------------------------------------
if __name__ == '__main__':
unittest.main()