[Liblas-commits] hg: more test cleanup

liblas-commits at liblas.org liblas-commits at liblas.org
Tue Dec 29 14:00:45 EST 2009


changeset 2ff9a45f4843 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=2ff9a45f4843
summary: more test cleanup

diffstat:

 python/tests/SRS-GDAL.txt     |   2 ++
 python/tests/test_doctests.py |  33 ++++++++++++++++-----------------
 2 files changed, 18 insertions(+), 17 deletions(-)

diffs (74 lines):

diff -r 27c57fd31ed5 -r 2ff9a45f4843 python/tests/SRS-GDAL.txt
--- a/python/tests/SRS-GDAL.txt	Tue Dec 29 11:34:27 2009 -0600
+++ b/python/tests/SRS-GDAL.txt	Tue Dec 29 12:56:41 2009 -0600
@@ -12,6 +12,7 @@
   
   >>> s = srs.SRS()
   >>> s.set_userinput('EPSG:4326')
+  True
   >>> s.proj4 == '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs '
   True
   
@@ -28,6 +29,7 @@
   >>> int(p.x)
   47069244
   >>> f.set_srs(s2)
+  True
   >>> p = f.read(0)
   >>> s2.vlr_count()
   3
diff -r 27c57fd31ed5 -r 2ff9a45f4843 python/tests/test_doctests.py
--- a/python/tests/test_doctests.py	Tue Dec 29 11:34:27 2009 -0600
+++ b/python/tests/test_doctests.py	Tue Dec 29 12:56:41 2009 -0600
@@ -44,6 +44,7 @@
 import unittest
 import glob
 import os
+import copy
 
 optionflags = (doctest.REPORT_ONLY_FIRST_FAILURE |
                doctest.NORMALIZE_WHITESPACE |
@@ -52,28 +53,26 @@
 def list_doctests():
     
     files = glob.glob(os.path.join(os.path.dirname(__file__), '*.txt'))
+    import liblas
     
-    import liblas
-    if not liblas.HAVE_LIBGEOTIFF:
-        for f in files:
+    for f in copy.copy(files):
+        if liblas.HAVE_LIBGEOTIFF and liblas.HAVE_GDAL:
+            
+            # run GDAL's tests only
             if 'GeoTIFF' in f:
                 files.remove(f)
-    else:
-        for f in files:
-            if 'GDAL' or 'SRS.txt' in f:
-                files.remove(f)        
-    
-    if not liblas.HAVE_GDAL:
-        for f in files:
+            if 'SRS.txt' in f:
+                files.remove(f)
+        if liblas.HAVE_LIBGEOTIFF and not liblas.HAVE_GDAL:
             if 'GDAL' in f:
                 files.remove(f)
-
-    else:
-        # use GDAL's tests instead of geotiff's if we 
-        # have GDAL
-        # don't run the generic test if we have gdal
-        for f in files:
-            if 'GeoTIFF' or 'SRS.txt' in f:
+            if 'SRS.txt' in f:
+                files.remove(f)
+        
+        if not liblas.HAVE_LIBGEOTIFF and not liblas.HAVE_GDAL:
+            if 'GDAL' in f:
+                files.remove(f)
+            if 'GeoTIFF' in f:
                 files.remove(f)
     return files
 


More information about the Liblas-commits mailing list