コード例 #1
0
 def test_CppClone(self):
     # test what happens when Clone is called from C++
     if hasattr(wx, 'testCppClone'):
         evt1 = wx.PyEvent()
         evt1.attr = 'testCppClone'
         evt2 = wx.testCppClone(evt1)
         self.assertTrue(evt1.attr == evt2.attr)
コード例 #2
0
 def test_CppClone(self):
     # test what happens when Clone is called from C++
     if hasattr(wx, 'testCppClone'):
         evt1 = wx.PyEvent()
         evt1.attr = 'testCppClone'
         evt2 = wx.testCppClone(evt1)
         self.assertTrue(evt1.attr == evt2.attr)
コード例 #3
0
 def test_CppCloneDerived(self):
     # test what happens when Clone is called from C++
     if hasattr(wx, 'testCppClone'):
         evt1 = MyPyEvent()
         evt1.attr = 'testCppClone'
         evt2 = wx.testCppClone(evt1)
         self.assertTrue(evt1.attr == evt2.attr)
         self.assertTrue(isinstance(evt2, MyPyEvent))
コード例 #4
0
ファイル: test_pyevent.py プロジェクト: GadgetSteve/Phoenix
 def test_CppCloneDerived(self):
     # test what happens when Clone is called from C++
     if hasattr(wx, 'testCppClone'):
         evt1 = MyPyEvent()
         evt1.attr = 'testCppClone'
         evt2 = wx.testCppClone(evt1)
         self.assertTrue(evt1.attr == evt2.attr)
         self.assertTrue(isinstance(evt2, MyPyEvent))
コード例 #5
0
 def test_CppCloneRefCounts(self):
     # Since we're doing some funky stuff under the covers with Clone, make
     # sure that the reference counts on everything (before and after)
     # still make sense
     if hasattr(wx, 'testCppClone'):
         evt1 = wx.PyEvent()
         rc1 = sys.getrefcount(evt1)
         evt1.attr = 'Howdy!'
         evt2 = wx.testCppClone(evt1)
         rc2 = sys.getrefcount(evt2)
         rc3 = sys.getrefcount(evt1)
         self.assertTrue(rc1 == rc2 == rc3)
         self.assertTrue(evt1.attr == evt2.attr)
コード例 #6
0
 def test_CppCloneRefCounts(self):
     # Since we're doing some funky stuff under the covers with Clone, make
     # sure that the reference counts on everything (before and after)
     # still make sense
     if hasattr(wx, 'testCppClone'):
         evt1 = wx.PyEvent()
         rc1 = sys.getrefcount(evt1)
         evt1.attr = 'Howdy!'
         evt2 = wx.testCppClone(evt1)
         rc2 = sys.getrefcount(evt2)
         rc3 = sys.getrefcount(evt1)
         self.assertTrue(rc1 == rc2 == rc3)
         self.assertTrue(evt1.attr == evt2.attr)