mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-07 12:30:07 +01:00
Merge branch 'master' into update-wx
This commit is contained in:
@@ -63,7 +63,7 @@ class BitmapTests(wtc.WidgetTestCase):
|
||||
else:
|
||||
self.assertTrue( b2.__nonzero__() == b2.IsOk() )
|
||||
|
||||
# check that the __nonzero__ method can be used with if satements
|
||||
# check that the __nonzero__ method can be used with if statements
|
||||
nzcheck = False
|
||||
if b2:
|
||||
nzcheck = True
|
||||
|
||||
@@ -75,7 +75,7 @@ class CursorTests(wtc.WidgetTestCase):
|
||||
else:
|
||||
self.assertTrue( c2.__nonzero__() == c2.IsOk() )
|
||||
|
||||
# check that the __nonzero__ method can be used with if satements
|
||||
# check that the __nonzero__ method can be used with if statements
|
||||
nzcheck = False
|
||||
if c2:
|
||||
nzcheck = True
|
||||
|
||||
@@ -262,7 +262,7 @@ class dataview_Tests(wtc.WidgetTestCase):
|
||||
count2 = model.GetRefCount()
|
||||
|
||||
# The reference count should still be 1 because the model was
|
||||
# DecRef'ed when it's ownership transfered to C++ in the
|
||||
# DecRef'ed when it's ownership transferred to C++ in the
|
||||
# AssociateModel call
|
||||
self.assertEqual(count2, 1)
|
||||
self.assertTrue(count2 == count1)
|
||||
|
||||
@@ -35,7 +35,7 @@ class deadobj_Tests(wtc.WidgetTestCase):
|
||||
|
||||
def test_deadobjException(self):
|
||||
# There should be a RuntimeError exception if we try to use an object
|
||||
# after it's C++ parts have been detroyed.
|
||||
# after it's C++ parts have been destroyed.
|
||||
p = wx.Panel(self.frame)
|
||||
p.Destroy()
|
||||
with self.assertRaises(RuntimeError):
|
||||
|
||||
@@ -241,6 +241,28 @@ class Events(wtc.WidgetTestCase):
|
||||
|
||||
|
||||
|
||||
def test_eventUnbinding5(self):
|
||||
"Unbind in same order of binding"
|
||||
|
||||
class Frame(wx.Frame):
|
||||
def __init__(self, *args, **kw):
|
||||
wx.Frame.__init__(self, *args, **kw)
|
||||
self.btn = wx.Button(self, label="Hello, wxPython!")
|
||||
self.btn.Bind(wx.EVT_BUTTON, self.onButton1)
|
||||
self.btn.Bind(wx.EVT_BUTTON, self.onButton2)
|
||||
def onButton1(self, evt):
|
||||
evt.Skip()
|
||||
def onButton2(self, evt):
|
||||
evt.Skip()
|
||||
|
||||
frm = Frame(None)
|
||||
ub1 = frm.btn.Unbind(wx.EVT_BUTTON, handler=frm.onButton1)
|
||||
ub2 = frm.btn.Unbind(wx.EVT_BUTTON, handler=frm.onButton2)
|
||||
|
||||
assert ub1, "Expected Unbind() success"
|
||||
assert ub2, "Expected Unbind() success"
|
||||
|
||||
|
||||
def test_DropFilesEvent_tweaks(self):
|
||||
evt = wx.DropFilesEvent(123, 'one two three four five'.split())
|
||||
self.assertTrue(evt.NumberOfFiles == 5)
|
||||
|
||||
@@ -266,7 +266,7 @@ class lib_pubsub_Except(wtc.PubsubTestCase):
|
||||
pass # parent's arg1 missing
|
||||
|
||||
# with getOrCreateTopic(topic, proto), the 'required args' set
|
||||
# is garanteed to be a subset of 'all args'
|
||||
# is guaranteed to be a subset of 'all args'
|
||||
self.pub.getDefaultTopicMgr().getOrCreateTopic('tasd', ok_0)
|
||||
self.pub.getDefaultTopicMgr().getOrCreateTopic('tasd.t_1', ok_1)
|
||||
self.assertRaises(self.pub.MessageDataSpecError, self.pub.getDefaultTopicMgr().getOrCreateTopic,
|
||||
@@ -298,7 +298,7 @@ class lib_pubsub_Except(wtc.PubsubTestCase):
|
||||
self.pub.getDefaultTopicMgr().newTopic('tasd.t_2.t_23', 'desc', ('arg1',), arg1='docs for arg1') # ok_21
|
||||
check('t_2.t_24', ('arg2',), arg2='docs for arg2') # err_22
|
||||
|
||||
# check when no inheritence involved
|
||||
# check when no inheritance involved
|
||||
# reqd args wrong
|
||||
check('t_1.t_16', ('arg1',), arg2='docs for arg2')
|
||||
check('t_1.t_17', ('arg2',), arg1='docs for arg1')
|
||||
|
||||
Reference in New Issue
Block a user