joey: thuban/Extensions/wms/test test_ogclib.py,1.5,1.6
cvs@intevation.de
cvs at intevation.de
Fri Mar 19 18:02:13 CET 2004
Author: joey
Update of /thubanrepository/thuban/Extensions/wms/test
In directory doto:/tmp/cvs-serv25617
Modified Files:
test_ogclib.py
Log Message:
Removed a space before an opening parenthesis
Index: test_ogclib.py
===================================================================
RCS file: /thubanrepository/thuban/Extensions/wms/test/test_ogclib.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- test_ogclib.py 19 Mar 2004 16:57:31 -0000 1.5
+++ test_ogclib.py 19 Mar 2004 17:02:11 -0000 1.6
@@ -25,7 +25,7 @@
from sys import path
from adjustpath import thubandir
-path.insert (0, thubandir + "/test")
+path.insert(0, thubandir + "/test")
import support
@@ -37,9 +37,9 @@
# Assume the PyOGCLib to be checked out next to the thuban main directory
# setting PYTHONPATH accordingly is fine as well
#
-pyogclib = os.path.abspath (thubandir + "/../PyOGCLib")
-if os.path.isdir (pyogclib) and os.path.isdir (pyogclib + "/ogclib"):
- path.insert (0, pyogclib)
+pyogclib = os.path.abspath(thubandir + "/../PyOGCLib")
+if os.path.isdir(pyogclib) and os.path.isdir(pyogclib + "/ogclib"):
+ path.insert(0, pyogclib)
# ----------------------------------------------------------------------
_pyogclib_import_error = None
@@ -49,7 +49,7 @@
_pyogclib_import_error = str(extra)
-class TestOGCLib (unittest.TestCase):
+class TestOGCLib(unittest.TestCase):
"""
Defines a test environment for the PyOGCLib, i.e. check whether URL
strings are built properly.
@@ -57,11 +57,11 @@
wmsclient = None
- def setUp (self):
+ def setUp(self):
skip_if_no_ogclib()
self.wmsclient = WMSClient()
- def compare_URLs (self, foo, bar):
+ def compare_URLs(self, foo, bar):
"""
Check if two URLs are equal, i.e.:
- check for same base URL
@@ -69,64 +69,64 @@
- check whether all arguments from one URL also exist in the second
"""
- foo_tuple = split (foo, "?")
- bar_tuple = split (bar, "?")
+ foo_tuple = split(foo, "?")
+ bar_tuple = split(bar, "?")
# Check for same base URL
if foo_tuple[0] != bar_tuple[0]:
- self.fail ("%s != %s" % (foo_tuple[0], bar_tuple[0]))
+ self.fail("%s != %s" %(foo_tuple[0], bar_tuple[0]))
# Check for same number of HTTP GET arguments
if len(foo_tuple) != len(bar_tuple):
- self.fail ("One URL has no arguments");
+ self.fail("One URL has no arguments");
# Loop through all HTTP GET arguments for existance
if len(foo_tuple) > 1 and len(bar_tuple) > 1:
- foo_opts = split (foo_tuple[1], "&")
- bar_opts = split (bar_tuple[1], "&")
+ foo_opts = split(foo_tuple[1], "&")
+ bar_opts = split(bar_tuple[1], "&")
if len(foo_opts) != len(bar_opts):
- self.fail ("Different number of arguments");
+ self.fail("Different number of arguments");
for part in foo_opts:
if part not in bar_opts:
- self.fail ("%s not in second argument list" % part);
+ self.fail("%s not in second argument list" % part);
- def test_compareURLs (self):
+ def test_compareURLs(self):
"""Perform some tests for own compare routine"""
result = "http://frida.intevation.org/cgi-bin"
- self.compare_URLs ("http://frida.intevation.org/cgi-bin", result)
+ self.compare_URLs("http://frida.intevation.org/cgi-bin", result)
result = "http://frida.intevation.org/cgi-bin?foo=eins"
- self.compare_URLs ("http://frida.intevation.org/cgi-bin?foo=eins", result)
+ self.compare_URLs("http://frida.intevation.org/cgi-bin?foo=eins", result)
result = "http://frida.intevation.org/cgi-bin?foo=eins&bar=zwei"
- self.compare_URLs ("http://frida.intevation.org/cgi-bin?foo=eins&bar=zwei", result)
+ self.compare_URLs("http://frida.intevation.org/cgi-bin?foo=eins&bar=zwei", result)
result = "http://frida.intevation.org/cgi-bin?foo=eins&bar=zwei"
- self.compare_URLs ("http://frida.intevation.org/cgi-bin?bar=zwei&foo=eins", result)
+ self.compare_URLs("http://frida.intevation.org/cgi-bin?bar=zwei&foo=eins", result)
result = "http://frida.intevation.org/cgi-bin?foo=eins&bar=zwei&baz=jan&quux=tux"
- self.compare_URLs ("http://frida.intevation.org/cgi-bin?baz=jan&bar=zwei&quux=tux&foo=eins", result)
+ self.compare_URLs("http://frida.intevation.org/cgi-bin?baz=jan&bar=zwei&quux=tux&foo=eins", result)
- def test_CapabilityURL (self):
+ def test_CapabilityURL(self):
"""Test the getCapabilitiesURL() method"""
frida = "http://frida.intevation.org/cgi-bin/frida_wms?"
url = self.wmsclient.getCapabilitiesURL(frida, "1.0")
result = frida + "WMTVER=1.0&REQUEST=capabilities"
- self.compare_URLs (url, result)
+ self.compare_URLs(url, result)
url = self.wmsclient.getCapabilitiesURL(frida, "1.1")
result = frida + "VERSION=1.1&SERVICE=WMS&REQUEST=GetCapabilities"
- self.compare_URLs (url, result)
+ self.compare_URLs(url, result)
- def test_GetMapURL (self):
+ def test_GetMapURL(self):
"""Test the getMapURL() method"""
frida = "http://frida.intevation.org/cgi-bin/frida_wms?"
@@ -143,8 +143,8 @@
result_base = frida + "WMTVER=1.0&REQUEST=map" + \
"&FORMAT="+format_enc + \
- "&SRS=EPSG%s%d" % ("%3A", epsg) + \
- "&BBOX=%f%s%f%s%f%s%f" % (bbox['minx'], "%2C", bbox['miny'], "%2C",
+ "&SRS=EPSG%s%d" %("%3A", epsg) + \
+ "&BBOX=%f%s%f%s%f%s%f" %(bbox['minx'], "%2C", bbox['miny'], "%2C",
bbox['maxx'], "%2C", bbox['maxy']) + \
"&WIDTH=%s" % width + "&HEIGHT=%s" % height
result = result_base + \
@@ -157,8 +157,8 @@
version = '1.1'
result_base = frida + "VERSION=1.1&SERVICE=WMS&REQUEST=GetMap" + \
"&FORMAT="+format_enc + \
- "&SRS=EPSG%s%d" % ("%3A", epsg) + \
- "&BBOX=%f%s%f%s%f%s%f" % (bbox['minx'], "%2C", bbox['miny'], "%2C",
+ "&SRS=EPSG%s%d" %("%3A", epsg) + \
+ "&BBOX=%f%s%f%s%f%s%f" %(bbox['minx'], "%2C", bbox['miny'], "%2C",
bbox['maxx'], "%2C", bbox['maxy']) + \
"&WIDTH=%s" % width + "&HEIGHT=%s" % height
result = result_base + \
@@ -166,19 +166,19 @@
"&STYLES=" + "%2C".join(styles)
url = self.wmsclient.getMapURL(frida, format, width, height, epsg,
bbox, layers, version=version)
- self.compare_URLs (result, url)
+ self.compare_URLs(result, url)
result += "&TRANSPARENT=TRUE"
url = self.wmsclient.getMapURL(frida, format, width, height, epsg,
bbox, layers, version=version,
transparent=1 )
- self.compare_URLs (result, url)
+ self.compare_URLs(result, url)
result += "&BGCOLOR=0xFF00FF"
url = self.wmsclient.getMapURL(frida, format, width, height, epsg,
bbox, layers, version=version,
transparent=1, bgcolor='0xFF00FF')
- self.compare_URLs (result, url)
+ self.compare_URLs(result, url)
layers = [ 'foo' ]
result = result_base + \
@@ -186,15 +186,15 @@
"&STYLES=" + "%2C".join(styles)
url = self.wmsclient.getMapURL(frida, format, width, height, epsg,
bbox, layers, version=version)
- self.compare_URLs (result, url)
+ self.compare_URLs(result, url)
- layers.append ('bar')
+ layers.append('bar')
result = result_base + \
"&LAYERS=" + "%2C".join(layers) + \
"&STYLES=" + "%2C".join(styles)
url = self.wmsclient.getMapURL(frida, format, width, height, epsg,
bbox, layers, version=version)
- self.compare_URLs (result, url)
+ self.compare_URLs(result, url)
styles = [ 'something' ]
result = result_base + \
@@ -203,16 +203,16 @@
url = self.wmsclient.getMapURL(frida, format, width, height, epsg,
bbox, layers, version=version,
styles = styles)
- self.compare_URLs (result, url)
+ self.compare_URLs(result, url)
- styles.append ('else')
+ styles.append('else')
result = result_base + \
"&LAYERS=" + "%2C".join(layers) + \
"&STYLES=" + "%2C".join(styles)
url = self.wmsclient.getMapURL(frida, format, width, height, epsg,
bbox, layers, version=version,
styles = styles)
- self.compare_URLs (result, url)
+ self.compare_URLs(result, url)
def skip_if_no_ogclib():
More information about the Thuban-devel
mailing list
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)