Running the tests

Anthony Lenton antoniolenton at gmail.com
Tue Jun 3 01:33:54 CEST 2008


On Mon, Jun 2, 2008 at 12:01 PM, Bernhard Reiter <bernhard at intevation.de> wrote:
> Hi Anthony,
>
> On Thursday 29 May 2008 00:12, Anthony Lenton wrote:
>> I checked out thuban's svn today, hopefully to start sending in a
>> patch or two or writing an extension.
>> After a while I was able to run the tests.
>
> good! Any contribution is welcome! :)

Thanks for the welcome.  Now I'll really have to sit down and write some code :P

>> Those needing gdalwarp were skipped until I realised that I needed to
>> compile the extensions, and the ones needing postgis needed a bit of a
>> help to figure out where the postgis SQL file was (find_postgis_sql
>> wasn't figuring out my Ubuntu Hardy installation).
>
> If you have a suggestion how to improve the documentation
> to make this easier for others, please let me know.

I guess it has to do with how I set out to run the tests, trying to
run the main test suite before compiling the extensions.
I couldn't come up with anything great, but if the test shows the
failed gdal_support_status it helps a bit, though it might be overly
verbose (gdal_support_status doesn't currently give hints about how to
fix the actual problem, but it could):

Index: test/test_baserenderer.py
===================================================================
--- test/test_baserenderer.py	(revisión: 2842)
+++ test/test_baserenderer.py	(copia de trabajo)
@@ -102,7 +102,7 @@
                                resolution, dimensions, options):

         if not Thuban.Model.resource.has_gdal_support():
-            raise support.SkipTest("No gdal support")
+            raise support.SkipTest(Thuban.Model.resource.gdal_support_status)

         #print srcProj, dstProj,extents, resolution, dimensions, options

@@ -281,7 +281,7 @@

     def test_projected_raster_layer(self):
         if not Thuban.Model.resource.has_gdal_support():
-            raise support.SkipTest("No gdal support")
+            raise support.SkipTest(Thuban.Model.resource.gdal_support_status)

         layer = RasterLayer("raster layer",
                             os.path.join("..", "Data", "iceland",
@@ -347,7 +347,7 @@

     def test_projected_raster_decimalcommalocale(self):
         if not Thuban.Model.resource.has_gdal_support():
-            raise support.SkipTest("No gdal support")
+            raise support.SkipTest(Thuban.Model.resource.gdal_support_status)

         def _do_project_island():
             """Project island.tif and return result."""
@@ -381,7 +381,7 @@
         returned by gdalwarp.ProjectRasterFile to a BMP file data.
         """
         if not Thuban.Model.resource.has_gdal_support():
-            raise support.SkipTest("No gdal support")
+            raise support.SkipTest(Thuban.Model.resource.gdal_support_status)

         map = Map("TestBaseRenderer")

Index: test/test_layer.py
===================================================================
--- test/test_layer.py	(revisión: 2842)
+++ test/test_layer.py	(copia de trabajo)
@@ -226,7 +226,7 @@

     def test_raster_layer(self):
         if not Thuban.Model.resource.has_gdal_support():
-            raise support.SkipTest("No gdal support")
+            raise support.SkipTest(Thuban.Model.resource.gdal_support_status)

         filename = self.build_path("island.tif")
         layer = RasterLayer("Test RasterLayer", filename)
@@ -475,7 +475,7 @@

     def test_raster_layer(self):
         if not Thuban.Model.resource.has_gdal_support():
-            raise support.SkipTest("No gdal support")
+            raise support.SkipTest(Thuban.Model.resource.gdal_support_status)


         filename = self.build_path("island.tif")




-- 
Anthony Lenton
Except - The good guys in software development
http://except.com.ar




More information about the Thuban-devel mailing list

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