Merge pull request #1749 from StefanBruens/test_fixes

Unittest fixes
This commit is contained in:
Robin Dunn
2020-07-31 10:50:27 -07:00
committed by GitHub
4 changed files with 27 additions and 22 deletions

View File

@@ -15,7 +15,7 @@ class TestPoint(unittest.TestCase):
def test_RealPoint_ctor(self):
p = wx.Point(wx.RealPoint(1.2, 2.9))
self.assertTrue(p == (1,2))
self.assertTrue(p == (1,3))
def test_copy_ctor(self):
p1 = wx.Point(3,4)
@@ -299,8 +299,8 @@ class TestSize(unittest.TestCase):
assert v1 == (12, 16)
assert v2 == (12, 16)
assert v3 == (13, 17)
assert v4 == (14, 19)
assert v3 == (13, 18)
assert v4 == (15, 20)
#---------------------------------------------------------------------------

View File

@@ -48,11 +48,7 @@ class srchctrl_Tests(wtc.WidgetTestCase):
t = wx.SearchCtrl(self.frame)
t.Cut
t.CanCut
t.DiscardEdits
t.GetDefaultStyle
t.GetNumberOfLines
t.GetStyle
t.IsModified
t.IsEditable
t.HitTest
t.AppendText
t.WriteText

View File

@@ -59,16 +59,25 @@ class stc_Tests(wtc.WidgetTestCase):
ed.EmptyUndoBuffer()
ed.GotoPos(0)
ed.IndicatorSetStyle(0, stc.STC_INDIC_SQUIGGLE)
ed.IndicatorSetForeground(0, wx.RED)
ed.IndicatorSetStyle(1, stc.STC_INDIC_DIAGONAL)
ed.IndicatorSetForeground(1, wx.BLUE)
ed.IndicatorSetStyle(2, stc.STC_INDIC_STRIKE)
ed.IndicatorSetForeground(2, wx.RED)
ed.StartStyling(100, stc.STC_INDICS_MASK)
ed.SetStyling(10, stc.STC_INDIC0_MASK)
ed.SetStyling(8, stc.STC_INDIC1_MASK)
ed.SetStyling(10, stc.STC_INDIC2_MASK | stc.STC_INDIC1_MASK)
ed.INDICSTYLE00 = 0
ed.INDICSTYLE01 = 1
ed.INDICSTYLE02 = 2
ed.IndicatorSetStyle(ed.INDICSTYLE00, stc.STC_INDIC_SQUIGGLE)
ed.IndicatorSetForeground(ed.INDICSTYLE00, wx.RED)
ed.IndicatorSetStyle(ed.INDICSTYLE01, stc.STC_INDIC_DIAGONAL)
ed.IndicatorSetForeground(ed.INDICSTYLE01, wx.BLUE)
ed.IndicatorSetStyle(ed.INDICSTYLE02, stc.STC_INDIC_STRIKE)
ed.IndicatorSetForeground(ed.INDICSTYLE02, wx.RED)
ed.StartStyling(100)
ed.SetIndicatorCurrent(ed.INDICSTYLE00)
ed.IndicatorFillRange(836, 10)
ed.SetIndicatorCurrent(ed.INDICSTYLE01)
ed.IndicatorFillRange(846, 8)
ed.SetIndicatorCurrent(ed.INDICSTYLE02)
ed.IndicatorFillRange(854, 10)
def test_stcStyleTextCtrl3(self):
@@ -84,11 +93,12 @@ class stc_Tests(wtc.WidgetTestCase):
ed.StyleSetSpec(3, "face:%s,bold,size:%d" % (face2, pb))
ed.StyleSetSpec(4, "face:%s,size:%d" % (face1, pb-1))
ed.StyleSetSpec(5, "back:#FFF0F0")
ed.StartStyling(80, 0xff)
ed.StartStyling(80)
ed.SetStyling(6, 1)
ed.StartStyling(100, 0xff)
ed.StartStyling(100)
ed.SetStyling(20, 2)
ed.StartStyling(180, 0xff)
ed.StartStyling(180)
ed.SetStyling(4, 3)
ed.SetStyling(2, 0)
ed.SetStyling(10, 4)

View File

@@ -25,7 +25,6 @@ class toolbar_Tests(wtc.WidgetTestCase):
wx.TB_BOTTOM
wx.TB_RIGHT
wx.TB_3DBUTTONS
wx.TB_FLAT
wx.TB_DOCKABLE
wx.TB_NOICONS