mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-05 11:30:06 +01:00
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:
@@ -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
|
||||
|
||||
@@ -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.')
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user