forked from wxWidgets/wxPython-Classic
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestGraphicsBrush.py
More file actions
41 lines (31 loc) · 1.27 KB
/
Copy pathtestGraphicsBrush.py
File metadata and controls
41 lines (31 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
"""Unit tests for wx.GraphicsBrush.
TODO: The docs say the only valid way to make an instance
is with a CreateBrush call on a renderer or context.
The constructor works but produces null brushes.
is this correct?
Methods yet to test:
__del__"""
import unittest
import wx
import testGraphicsObject
class GraphicsBrushTest(testGraphicsObject.GraphicsObjectTest):
def setUp(self):
self.color = wx.Colour(0,0,0)
self.brush = wx.Brush(self.color)
self.renderer = wx.GraphicsRenderer.GetDefaultRenderer()
self.testControl = self.renderer.CreateBrush(self.brush)
def testConstructor_wxGraphicsBrushOnly(self):
"""__init__"""
brush = wx.GraphicsBrush()
self.assert_(isinstance(brush, wx.GraphicsBrush))
def testGetRenderer(self):
"""GetRenderer"""
# Overrides test in testGraphicsObject.GraphicsObjectTest
self.assertEquals(repr(self.renderer), repr(self.testControl.GetRenderer()))
def testIsNullTrue(self):
"""IsNull"""
# Overrides test in testGraphicsObject.GraphicsObjectTest
self.testControl = wx.GraphicsBrush()
self.assert_(self.testControl.IsNull())
if __name__ == '__main__':
unittest.main()