mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2025-12-16 09:40:07 +01:00
Trim trailing space unittests directory
This commit is contained in:
@@ -10,25 +10,25 @@ class MyValidator(wx.Validator):
|
||||
def __init__(self, startingValue=""):
|
||||
wx.Validator.__init__(self)
|
||||
self.value = startingValue
|
||||
|
||||
|
||||
def Clone(self):
|
||||
return MyValidator(self.value)
|
||||
|
||||
|
||||
def TransferToWindow(self):
|
||||
self.GetWindow().SetValue(self.value)
|
||||
return True
|
||||
|
||||
|
||||
def TransferFromWindow(self):
|
||||
self.value = self.Window.Value # test using the properties
|
||||
self.value = self.Window.Value # test using the properties
|
||||
return True
|
||||
|
||||
|
||||
def Validate(self, parent):
|
||||
value = self.GetWindow().GetValue()
|
||||
return value in ["", "hello", "world"]
|
||||
|
||||
|
||||
class validate_Tests(wtc.WidgetTestCase):
|
||||
|
||||
|
||||
def setUp(self):
|
||||
super(validate_Tests, self).setUp()
|
||||
self.pnl = wx.Panel(self.frame)
|
||||
@@ -36,8 +36,8 @@ class validate_Tests(wtc.WidgetTestCase):
|
||||
self.frame.SendSizeEvent()
|
||||
validator = MyValidator("hello")
|
||||
self.tc.SetValidator(validator)
|
||||
|
||||
|
||||
|
||||
|
||||
def test_validateTransfer(self):
|
||||
self.assertTrue(self.tc.Value == "")
|
||||
self.pnl.TransferDataToWindow()
|
||||
@@ -46,12 +46,12 @@ class validate_Tests(wtc.WidgetTestCase):
|
||||
self.pnl.TransferDataFromWindow()
|
||||
v = self.tc.GetValidator()
|
||||
self.assertTrue(v.value == "world")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def test_validateDefault(self):
|
||||
wx.DefaultValidator
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user