def testSize(self): """SetSize, GetSize""" if wxtest.PlatformIsWindows(): self.testControl.SetSize(wx.Size(1, 1)) self.assertEquals(wx.Size(123, 34), self.testControl.GetSize()) else: super(FrameTest, self).testSize()
def testRect(self): """SetRect, GetRect""" if wxtest.PlatformIsWindows(): self.testControl.SetRect(wx.Rect(0, 0, 0, 0)) self.assertEquals(wx.Rect(0, 0, 123, 34), self.testControl.GetRect()) else: super(FrameTest, self).testSize()
def testFontweight(self): """__init__""" # wx.FONTWEIGHT_MAX dies (on Windows) if wxtest.PlatformIsWindows(): self.assertRaises(wx.PyAssertionError, wx.Font, 12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_MAX) else: wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_MAX)
def testShadowWidth(self): """SetShadowWidth, GetShadowWidth""" if wxtest.PlatformIsMac() or wxtest.PlatformIsGtk() or \ wxtest.PlatformIsWindows(): for i in range(self.testControl.GetRange()): self.testControl.SetShadowWidth(i) self.assertEquals(0, self.testControl.GetShadowWidth()) else: # this can't happen. # TODO: what platforms does it work on? raise EnvironmentError( "Current platform not represented in wxtest")