jonathan: thuban/test test_baserenderer.py, 1.13, 1.14 test_layer.py, 1.35, 1.36
cvs@intevation.de
cvs at intevation.de
Wed Mar 23 16:30:29 CET 2005
Author: jonathan
Update of /thubanrepository/thuban/test
In directory doto:/tmp/cvs-serv32375/test
Modified Files:
test_baserenderer.py test_layer.py
Log Message:
Add support for adjusting the opacity of a raster layer.
Index: test_baserenderer.py
===================================================================
RCS file: /thubanrepository/thuban/test/test_baserenderer.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- test_baserenderer.py 18 Feb 2005 19:28:45 -0000 1.13
+++ test_baserenderer.py 23 Mar 2005 15:30:27 -0000 1.14
@@ -91,7 +91,7 @@
def label_font(self):
return "label font"
- def draw_raster_data(self, x, y, data, format='BMP'):
+ def draw_raster_data(self, layer, x, y, data, format='BMP'):
self.raster_data = data
self.raster_format = format
Index: test_layer.py
===================================================================
RCS file: /thubanrepository/thuban/test/test_layer.py,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- test_layer.py 16 Feb 2005 21:14:47 -0000 1.35
+++ test_layer.py 23 Mar 2005 15:30:27 -0000 1.36
@@ -485,18 +485,25 @@
layer.SetMaskType(layer.MASK_ALPHA)
self.failIf(layer.MaskType() != layer.MASK_ALPHA)
- layer.SetAlphaOpacity(0)
- self.assertEquals(layer.AlphaOpacity(), 0)
- layer.SetAlphaOpacity(0.5)
- self.assertEquals(layer.AlphaOpacity(), 0.5)
- layer.SetAlphaOpacity(1)
- self.assertEquals(layer.AlphaOpacity(), 1)
+ layer.SetOpacity(0)
+ self.assertEquals(layer.Opacity(), 0)
+ layer.SetOpacity(0.5)
+ self.assertEquals(layer.Opacity(), 0.5)
- self.assertRaises(ValueError, layer.SetAlphaOpacity, -0.1)
- self.assertRaises(ValueError, layer.SetAlphaOpacity, 1.1)
+ self.clear_messages()
+ layer.SetOpacity(1)
+ self.assertEquals(layer.Opacity(), 1)
+ self.check_messages([(layer, LAYER_CHANGED)])
+ self.clear_messages()
+
+ self.assertRaises(ValueError, layer.SetOpacity, -0.1)
+ self.assertRaises(ValueError, layer.SetOpacity, 1.1)
layer.SetMaskType(layer.MASK_NONE)
- self.assertEquals(layer.AlphaOpacity(), None)
+ self.clear_messages()
+ self.assertEquals(layer.Opacity(), 1)
+ self.check_messages([])
+ self.clear_messages()
self.assertRaises(ValueError, layer.SetMaskType, -1)
self.assertRaises(ValueError, layer.SetMaskType, 4)
More information about the Thuban-devel
mailing list
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)