bh: thuban/test test_layer.py,1.29,1.30
cvs@intevation.de
cvs at intevation.de
Thu Jun 3 17:18:09 CEST 2004
Author: bh
Update of /thubanrepository/thuban/test
In directory doto:/tmp/cvs-serv19492/test
Modified Files:
test_layer.py
Log Message:
(TestLayerModification.setUp): Save the
filename as an instance variable so we can refer to it in tests
(TestLayerModification.test_tree_info): Uncomment this method
again and make it work. This tests for the formatting issue
filed in RT#2239 on 2004-01-13
Index: test_layer.py
===================================================================
RCS file: /thubanrepository/thuban/test/test_layer.py,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- test_layer.py 28 Nov 2003 11:37:35 -0000 1.29
+++ test_layer.py 3 Jun 2004 15:18:07 -0000 1.30
@@ -1,4 +1,4 @@
-# Copyright (c) 2002, 2003 by Intevation GmbH
+# Copyright (c) 2002, 2003, 2004 by Intevation GmbH
# Authors:
# Bernhard Herzog <bh at intevation.de>
#
@@ -355,9 +355,9 @@
"""
self.clear_messages()
self.session = Session("Test session for %s" % self.__class__)
- filename = os.path.join("..", "Data", "iceland", "political.shp")
+ self.filename = os.path.join("..", "Data", "iceland", "political.shp")
self.layer = Layer("Test Layer",
- self.session.OpenShapefile(filename))
+ self.session.OpenShapefile(self.filename))
self.layer.Subscribe(LAYER_LEGEND_CHANGED, self.subscribe_with_params,
LAYER_LEGEND_CHANGED)
self.layer.Subscribe(LAYER_VISIBILITY_CHANGED,
@@ -416,20 +416,16 @@
self.failUnless(self.layer.WasModified())
-#
-# the tree info now contains Color objects which are difficult to test
-#
-# def test_tree_info(self):
-# """Test Layer.TreeInfo"""
-# self.assertEquals(self.layer.TreeInfo(),
-# ("Layer 'Test Layer'",
-# ['Shown',
-# 'Shapes: 156',
-# ('Extent (lat-lon):'
-# ' (-24.5465, 63.2868, -13.4958, 66.5638)'),
-# 'Shapetype: Polygon',
-# 'Fill: None',
-# 'Outline: (0.000, 0.000, 0.000)']))
+ def test_tree_info(self):
+ """Test Layer.TreeInfo"""
+ self.assertEquals(self.layer.TreeInfo(),
+ ("Layer 'Test Layer'",
+ ['Filename: %s' % os.path.abspath(self.filename),
+ 'Shown',
+ 'Shapes: 156',
+ 'Extent (lat-lon): (-24.5465, 63.2868, -13.4958, 66.5638)',
+ 'Shapetype: Polygon',
+ self.layer.GetClassification()]))
if __name__ == "__main__":
More information about the Thuban-devel
mailing list
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)