Files
Phoenix/unittests/test_brush.py
Robin Dunn 26417adce8 updated and new unittests
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@69157 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-09-20 04:43:51 +00:00

62 lines
1.8 KiB
Python

import imp_unittest, unittest
import wtc
import wx
import os
pngFile = os.path.join(os.path.dirname(__file__), 'toucan.png')
#---------------------------------------------------------------------------
class BrushTests(wtc.WidgetTestCase):
def test_BrushCtors(self):
b = wx.Brush()
b = wx.Brush(wx.Colour(1,2,3), wx.BRUSHSTYLE_SOLID)
bmp = wx.Bitmap(pngFile)
b = wx.Brush(bmp)
copy = wx.Brush(b)
def test_BrushOperators(self):
b1 = wx.Brush(wx.Colour(1,2,3), wx.BRUSHSTYLE_SOLID)
b2 = wx.Brush(wx.Colour(1,2,3), wx.BRUSHSTYLE_SOLID)
b3 = wx.Brush(wx.Colour(4,5,6), wx.BRUSHSTYLE_SOLID)
self.assertTrue(b1 == b2)
self.assertTrue(b2 != b3)
self.assertFalse(b1 != b2)
self.assertFalse(b2 == b3)
def test_StockBrushesExist(self):
wx.BLUE_BRUSH
wx.GREEN_BRUSH
wx.YELLOW_BRUSH
wx.WHITE_BRUSH
wx.BLACK_BRUSH
wx.GREY_BRUSH
wx.MEDIUM_GREY_BRUSH
wx.LIGHT_GREY_BRUSH
wx.TRANSPARENT_BRUSH
wx.CYAN_BRUSH
wx.RED_BRUSH
def test_StockBrushesInitialized(self):
self.assertTrue(wx.BLUE_BRUSH.IsOk())
self.assertTrue(wx.GREEN_BRUSH.IsOk())
self.assertTrue(wx.YELLOW_BRUSH.IsOk())
self.assertTrue(wx.WHITE_BRUSH.IsOk())
self.assertTrue(wx.BLACK_BRUSH.IsOk())
self.assertTrue(wx.GREY_BRUSH.IsOk())
self.assertTrue(wx.MEDIUM_GREY_BRUSH.IsOk())
self.assertTrue(wx.LIGHT_GREY_BRUSH.IsOk())
self.assertTrue(wx.TRANSPARENT_BRUSH.IsOk())
self.assertTrue(wx.CYAN_BRUSH.IsOk())
self.assertTrue(wx.RED_BRUSH.IsOk())
#---------------------------------------------------------------------------
if __name__ == '__main__':
unittest.main()