Add a unit test for wx.Clipboard

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@71410 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2012-05-10 22:39:24 +00:00
parent 2bd3ad68b6
commit 342459580d
2 changed files with 14 additions and 2 deletions

View File

@@ -41,6 +41,7 @@ def run():
c.addPyMethod('__enter__', '(self)', 'return self')
c.addPyMethod('__exit__', '(self, exc_type, exc_val, exc_tb)', 'self.Close()')
# TODO: This init wrapper class may be useful elsewhere...
module.addPyCode("""\
# Since wxTheClipoard is not really a global varaiable (it is a macro
# that calls the Get static method) we can't declare it as a global

View File

@@ -6,9 +6,20 @@ import wx
class clipbrd_Tests(wtc.WidgetTestCase):
# TODO: Remove this test and add real ones.
def test_clipbrd1(self):
self.fail("Unit tests for clipbrd not implemented yet.")
# copy
data1 = wx.TextDataObject('This is some data.')
if wx.TheClipboard.Open():
wx.TheClipboard.SetData(data1)
wx.TheClipboard.Close()
# paste
data2 = wx.TextDataObject()
if wx.TheClipboard.Open():
wx.TheClipboard.GetData(data2)
wx.TheClipboard.Close()
self.assertEqual(data2.GetText(), 'This is some data.')
#---------------------------------------------------------------------------