joey: thuban/Extensions/wms/test test_parser.py,1.8,1.9
cvs@intevation.de
cvs at intevation.de
Wed Mar 24 18:10:44 CET 2004
Author: joey
Update of /thubanrepository/thuban/Extensions/wms/test
In directory doto:/tmp/cvs-serv12437
Modified Files:
test_parser.py
Log Message:
Remove spaces before opening parathesis
Index: test_parser.py
===================================================================
RCS file: /thubanrepository/thuban/Extensions/wms/test/test_parser.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- test_parser.py 24 Mar 2004 17:00:37 -0000 1.8
+++ test_parser.py 24 Mar 2004 17:10:41 -0000 1.9
@@ -35,12 +35,12 @@
from Extensions.wms.parser import WMSCapabilitiesParser
-class TestWMSCapabilitiesParser (unittest.TestCase, WMSCapabilitiesParser):
+class TestWMSCapabilitiesParser(unittest.TestCase, WMSCapabilitiesParser):
"""
Defines a test environment for the class WMSCapabilities.
"""
- def compareLists (self, foo, bar):
+ def compareLists(self, foo, bar):
"""
Compare two lists
- check same number of elements
@@ -49,15 +49,15 @@
# Check for same number of elements
if len(foo) != len(bar):
- self.fail ("Different number of elements");
+ self.fail("Different number of elements");
# Loop through all elements for existance
for elm in foo:
if elm not in bar:
- self.fail ("%s not in second list" % elm);
+ self.fail("%s not in second list" % elm);
- def compareDicts (self, foo, bar):
+ def compareDicts(self, foo, bar):
"""
Compare two dictionaries (hashes)
- check same number of keys
@@ -66,14 +66,14 @@
# Check for same number of elements
if len(foo) != len(bar):
- self.fail ("Different number of keys");
+ self.fail("Different number of keys");
# Loop through all elements for existance
for key in foo.keys():
if key not in bar:
- self.fail ("%s not in second dictionary" % key);
+ self.fail("%s not in second dictionary" % key);
if foo[key] != bar[key]:
- self.fail ("%s has different value in second dictionary" % key);
+ self.fail("%s has different value in second dictionary" % key);
def setUp(self):
@@ -84,18 +84,18 @@
try:
try:
- f = open ("sample.xml", "r")
+ f = open("sample.xml", "r")
except:
- f = open (os.path.dirname (__file__) + "/sample.xml", "r")
+ f = open(os.path.dirname(__file__) + "/sample.xml", "r")
except:
print "Cannot open sample.xml for reading"
else:
- xml = f.read ();
+ xml = f.read();
f.close()
- self.grok (xml)
+ self.grok(xml)
- def test_grok (self):
+ def test_grok(self):
"""
Test whether grok() discovers discrepances in the SRS
elements, calculated and specified.
@@ -104,68 +104,68 @@
self.compareLists(['name:beschriftung'], self.srs_discrepances, )
- def test_general (self):
+ def test_general(self):
"""
Test general attributes extracted from Capabilities XML
"""
- self.assertEquals (self.getTitle().encode('latin-1'),'Frida - Freie Vektor-Geodaten Osnabrück')
- self.assertEquals (self.getAbstract(),'')
- self.assertEquals (self.getFees(),'')
- self.assertEquals (self.getAccessConstraints(),'')
+ self.assertEquals(self.getTitle().encode('latin-1'),'Frida - Freie Vektor-Geodaten Osnabrück')
+ self.assertEquals(self.getAbstract(),'')
+ self.assertEquals(self.getFees(),'')
+ self.assertEquals(self.getAccessConstraints(),'')
formats = ['image/gif', 'image/png', 'image/jpeg', 'image/wbmp']
- self.compareLists (self.getFormats(),formats)
+ self.compareLists(self.getFormats(),formats)
layers = ['Osnabrueck', 'gruenflaechen', 'gewaesser',
'gewaesserpolyl','gewaesserlinien', 'strassen_all',
'strassenhinten', 'strassen', 'beschriftung',
'hauptbeschriftung', 'sehenswuerdigkeiten']
- self.compareLists (self.getLayers(),layers)
- self.compareLists (self.getSRS(),['31493'])
+ self.compareLists(self.getLayers(),layers)
+ self.compareLists(self.getSRS(),['31493'])
- def test_LayerTitle (self):
+ def test_LayerTitle(self):
"""
Check if layer titles are recognised properly
"""
# main layer
- self.assertEquals (self.getLayerTitle('Osnabrueck').encode('latin-1'),'Frida - Freie Vektor-Geodaten Osnabrück')
+ self.assertEquals(self.getLayerTitle('Osnabrueck').encode('latin-1'),'Frida - Freie Vektor-Geodaten Osnabrück')
# first nested layer
- self.assertEquals (self.getLayerTitle('gruenflaechen').encode('latin-1'),'Grünflächen')
+ self.assertEquals(self.getLayerTitle('gruenflaechen').encode('latin-1'),'Grünflächen')
# first nested layer
- self.assertEquals (self.getLayerTitle('gewaesser').encode('latin-1'),'Gewässer')
+ self.assertEquals(self.getLayerTitle('gewaesser').encode('latin-1'),'Gewässer')
# second nested layer
- self.assertEquals (self.getLayerTitle('gewaesserpolyl').encode('latin-1'),'Gewässerflächen')
+ self.assertEquals(self.getLayerTitle('gewaesserpolyl').encode('latin-1'),'Gewässerflächen')
- def test_LayerSRS (self):
+ def test_LayerSRS(self):
"""
Check if the SRS are returned properly
"""
# SRS of main layer
- self.compareLists (self.getLayerSRS('Osnabrueck'),['31493'])
+ self.compareLists(self.getLayerSRS('Osnabrueck'),['31493'])
# Single SRS of layer without inheritance
- self.compareLists (self.getLayerSRS('gruenflaechen'),['31493'])
+ self.compareLists(self.getLayerSRS('gruenflaechen'),['31493'])
# Multiple SRS of layer without inheritance, but overwriting
- self.compareLists (self.getLayerSRS('gewaesserpolyl'),['31493', '31494'])
+ self.compareLists(self.getLayerSRS('gewaesserpolyl'),['31493', '31494'])
# Multiple SRS of layer with inheritance, one new locally
- self.compareLists (self.getLayerSRS('gewaesserlinien'),['31493', '31492'])
+ self.compareLists(self.getLayerSRS('gewaesserlinien'),['31493', '31492'])
# Multiple SRS with inheritance, two new locally
- self.compareLists (self.getLayerSRS('strassen'),['31493', '31494', '31495'])
+ self.compareLists(self.getLayerSRS('strassen'),['31493', '31494', '31495'])
# Single SRS with inheritance but overwriting
- self.compareLists (self.getLayerSRS('beschriftung'),['31493'])
+ self.compareLists(self.getLayerSRS('beschriftung'),['31493'])
- def test_LatLonBoundingBoxes (self):
+ def test_LatLonBoundingBoxes(self):
"""
Check if the LatLonBoundingBoxes are returned properly
"""
@@ -173,20 +173,20 @@
# main LatLonBoundingBox
bbox = {'minx': "7.92881", 'miny': "52.2131",
'maxx': "8.18349", 'maxy': "52.341"}
- self.compareDicts (self.getLayerLatLonBBox('Osnabrueck'),bbox)
+ self.compareDicts(self.getLayerLatLonBBox('Osnabrueck'),bbox)
# inherited LatLonBoundingBox
bbox = {'minx': "7.92881", 'miny': "52.2131",
'maxx': "8.18349", 'maxy': "52.341"}
- self.compareDicts (self.getLayerLatLonBBox('gewaesser'),bbox)
+ self.compareDicts(self.getLayerLatLonBBox('gewaesser'),bbox)
# third layer non-inherited LatLonBoundingBox
bbox = {'minx': "7.93531", 'miny': "52.2328",
'maxx': "8.17739", 'maxy': "52.3353"}
- self.compareDicts (self.getLayerLatLonBBox('gewaesserpolyl'),bbox)
+ self.compareDicts(self.getLayerLatLonBBox('gewaesserpolyl'),bbox)
- def test_BoundingBoxes (self):
+ def test_BoundingBoxes(self):
"""
Check if the BoundingBoxes are returned properly
"""
@@ -194,44 +194,44 @@
# main BoundingBox
bbox = {'minx': "3.427e+06", 'miny': "5.787e+06",
'maxx': "3.4442e+06", 'maxy': "5.801e+06"}
- self.compareDicts (self.getLayerBBox('Osnabrueck', '31493'),bbox)
+ self.compareDicts(self.getLayerBBox('Osnabrueck', '31493'),bbox)
# inherited BoundingBox
- self.compareDicts (self.getLayerBBox('gewaesser', '31493'),bbox)
+ self.compareDicts(self.getLayerBBox('gewaesser', '31493'),bbox)
# overwritten BoundingBox
bbox = {'minx': "3.427e+06", 'miny': "5.78901e+06",
'maxx': "3.44173e+06", 'maxy': "5.79952e+06"}
- self.compareDicts (self.getLayerBBox('gewaesserlinien', '31492'),bbox)
+ self.compareDicts(self.getLayerBBox('gewaesserlinien', '31492'),bbox)
# multiple BoundingBoxes
bbox = {'minx': "3.42743e+06", 'miny': "5.78919e+06",
'maxx': "3.44381e+06", 'maxy': "5.80038e+06"}
- self.compareDicts (self.getLayerBBox('gewaesserpolyl', '31493'),bbox)
+ self.compareDicts(self.getLayerBBox('gewaesserpolyl', '31493'),bbox)
bbox = {'minx': "3.42742e+06", 'miny': "5.78918e+06",
'maxx': "3.44380e+06", 'maxy': "5.80037e+06"}
- self.compareDicts (self.getLayerBBox('gewaesserpolyl', '31494'),bbox)
+ self.compareDicts(self.getLayerBBox('gewaesserpolyl', '31494'),bbox)
- def test_queryable (self):
+ def test_queryable(self):
"""
Check if layers are properly classified queryable or not
"""
# implicit setting in main layer
- self.assertEquals (self.isQueryable('Osnabrueck'),0)
+ self.assertEquals(self.isQueryable('Osnabrueck'),0)
# explicit setting in second layer
- self.assertEquals (self.isQueryable('gruenflaechen'),0)
+ self.assertEquals(self.isQueryable('gruenflaechen'),0)
# inherited setting in second layer
- self.assertEquals (self.isQueryable('gewaesser'),0)
+ self.assertEquals(self.isQueryable('gewaesser'),0)
# explicit setting in second layer
- self.assertEquals (self.isQueryable('sehenswuerdigkeiten'),1)
+ self.assertEquals(self.isQueryable('sehenswuerdigkeiten'),1)
# explicit setting in third layer
- self.assertEquals (self.isQueryable('strassen'),1)
+ self.assertEquals(self.isQueryable('strassen'),1)
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)