mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2025-07-21 12:41:10 +02:00
Explicitly calling ShowModal and Destroy avoids having WidgetTestCase's
tlw.Close(force=True) trigger an exception because the dialog's EVT_CLOSE handler is trying to call EndModal on a dialog which isn't modal.
This commit is contained in:
@@ -12,6 +12,9 @@ class lib_agw_cubecolourdialog_Tests(wtc.WidgetTestCase):
|
||||
colourData = wx.ColourData()
|
||||
colourData.SetColour(wx.RED)
|
||||
dlg = CCD.CubeColourDialog(self.frame, colourData, agwStyle=0)
|
||||
wx.CallLater(250, dlg.EndModal, wx.ID_OK)
|
||||
dlg.ShowModal()
|
||||
dlg.Destroy()
|
||||
|
||||
def test_lib_agw_cubecolourdialogMethods(self):
|
||||
colourData = wx.ColourData()
|
||||
@@ -28,6 +31,9 @@ class lib_agw_cubecolourdialog_Tests(wtc.WidgetTestCase):
|
||||
ccd_colour = CCD.Colour(wx.Colour(colour))
|
||||
html = CCD.rgb2html(ccd_colour)
|
||||
self.assertTrue(html in CCD.HTMLCodes)
|
||||
wx.CallLater(250, dlg.EndModal, wx.ID_OK)
|
||||
dlg.ShowModal()
|
||||
dlg.Destroy()
|
||||
|
||||
def test_lib_agw_cubecolourdialogConstantsExist(self):
|
||||
# CubeColourDialog agwStyle
|
||||
|
@@ -11,6 +11,9 @@ class lib_agw_multidirdialog_Tests(wtc.WidgetTestCase):
|
||||
def test_lib_agw_multidirdialogCtor(self):
|
||||
dlg = MDD.MultiDirDialog(self.frame, title="Custom MultiDirDialog",
|
||||
agwStyle=MDD.DD_MULTIPLE|MDD.DD_DIR_MUST_EXIST)
|
||||
wx.CallLater(250, dlg.EndModal, wx.ID_OK)
|
||||
dlg.ShowModal()
|
||||
dlg.Destroy()
|
||||
|
||||
def test_lib_agw_multidirdialogMethods(self):
|
||||
dlg = MDD.MultiDirDialog(self.frame, title="Custom MultiDirDialog",
|
||||
@@ -21,6 +24,9 @@ class lib_agw_multidirdialog_Tests(wtc.WidgetTestCase):
|
||||
# it looks like the generic dir ctrl may start out with an item
|
||||
# selected, so allow for that here
|
||||
self.assertTrue(len(dlg.GetPaths()) in [0,1])
|
||||
wx.CallLater(250, dlg.EndModal, wx.ID_OK)
|
||||
dlg.ShowModal()
|
||||
dlg.Destroy()
|
||||
|
||||
|
||||
def test_lib_agw_multidirdialogConstantsExist(self):
|
||||
|
Reference in New Issue
Block a user