bernhard: thuban/Extensions/svgexport/test test_svgmapwriter.py, 1.9, 1.10

cvs@intevation.de cvs at intevation.de
Tue Dec 7 12:19:40 CET 2004


Author: bernhard

Update of /thubanrepository/thuban/Extensions/svgexport/test
In directory doto:/tmp/cvs-serv16793/Extensions/svgexport/test

Modified Files:
	test_svgmapwriter.py 
Log Message:
svgexport 0.9.1, implemented DrawSpline:
	* Extensions/svgexport/test/test_svgmapwriter.py:
	Added test_drawbezier() to test DrawSpline().

	* Extensions/svgexport/svgmapwriter.py(DrawSpline):
	Really implemented bezier drawing.

	* Extensions/svgexport/__init__.py: Bumped version of svgexport
	to 0.9.1 because now the legend examples lines styles 
	will be drawing with beziers.


Index: test_svgmapwriter.py
===================================================================
RCS file: /thubanrepository/thuban/Extensions/svgexport/test/test_svgmapwriter.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- test_svgmapwriter.py	27 Nov 2004 20:22:38 -0000	1.9
+++ test_svgmapwriter.py	7 Dec 2004 11:19:38 -0000	1.10
@@ -161,6 +161,25 @@
         self.assertEquals(xmlsupport.sax_eventlist(data = data), 
                           xmlsupport.sax_eventlist(data = file.getvalue()))
     
+    def test_drawbezier(self):
+        '''Test DrawSpline (which actually draws bezier curves).'''
+        data = ('<path style="stroke-linejoin:round; stroke:#ff00ff; '
+                'stroke-width:3; stroke-linecap:round; fill:none" ' 
+                'meta="Object:test; Label:nothing" d="M 10 10 '
+                'C 15 12 15 8.0 20 10"/>')
+        file = StringIO.StringIO()
+        dc = VirtualDC(file)
+        dc.SetPen(self.solid_pen)
+        dc.SetMeta(self.meta)
+        dc.SetBrush(self.trans_brush)
+        dc.DrawSpline([ Point(10, 10),
+                        Point(15, 12),
+                        Point(15,  8.0),
+                        Point(20, 10) ])
+        #print file.getvalue()
+        self.assertEquals(xmlsupport.sax_eventlist(data = data), 
+                          xmlsupport.sax_eventlist(data = file.getvalue()))
+    
     def test_text(self):
         '''Set drawing properties and draw a circle'''
         data = ('<text x="123.321" y="1515.5151" style="font-size:12; '





More information about the Thuban-devel mailing list

This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)