[GRASS-SVN] r74287 - grass/trunk/vector/v.in.lidar/testsuite
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Mar 17 15:42:17 PDT 2019
Author: sbl
Date: 2019-03-17 15:42:17 -0700 (Sun, 17 Mar 2019)
New Revision: 74287
Modified:
grass/trunk/vector/v.in.lidar/testsuite/test_v_in_pdal_basic.py
grass/trunk/vector/v.in.lidar/testsuite/test_v_in_pdal_filter.py
Log:
skip test if v.in.pdal is not compiled
Modified: grass/trunk/vector/v.in.lidar/testsuite/test_v_in_pdal_basic.py
===================================================================
--- grass/trunk/vector/v.in.lidar/testsuite/test_v_in_pdal_basic.py 2019-03-17 22:13:35 UTC (rev 74286)
+++ grass/trunk/vector/v.in.lidar/testsuite/test_v_in_pdal_basic.py 2019-03-17 22:42:17 UTC (rev 74287)
@@ -12,8 +12,9 @@
import os
from grass.gunittest.case import TestCase
from grass.gunittest.main import test
+import unittest
+from grass.script import shutil_which
-
class BasicTest(TestCase):
"""Test case for watershed module
@@ -56,6 +57,7 @@
self.runModule('g.remove', flags='f', type='vector',
name=self.imported_points)
+ @unittest.skipIf(shutil_which('v.in.pdal') is None, "Cannot find v.in.pdal")
def test_same_data(self):
"""Test to see if the standard outputs are created"""
self.assertModule('v.in.pdal', input=self.las_file, flags='c',
Modified: grass/trunk/vector/v.in.lidar/testsuite/test_v_in_pdal_filter.py
===================================================================
--- grass/trunk/vector/v.in.lidar/testsuite/test_v_in_pdal_filter.py 2019-03-17 22:13:35 UTC (rev 74286)
+++ grass/trunk/vector/v.in.lidar/testsuite/test_v_in_pdal_filter.py 2019-03-17 22:42:17 UTC (rev 74287)
@@ -12,8 +12,9 @@
import os
from grass.gunittest.case import TestCase
from grass.gunittest.main import test
+import unittest
+from grass.script import shutil_which
-
POINTS = """\
17.46938776,18.67346939,143,1,1,2
20.93877551,17.44897959,125,1,1,2
@@ -84,6 +85,7 @@
self.runModule('g.remove', flags='f', type='vector',
name=self.imported_points)
+ @unittest.skipIf(shutil_which('v.in.pdal') is None, "Cannot find v.in.pdal")
def test_no_filter(self):
"""Test to see if the standard outputs are created
@@ -96,6 +98,7 @@
vector=self.imported_points,
reference=dict(points=19))
+ @unittest.skipIf(shutil_which('v.in.pdal') is None, "Cannot find v.in.pdal")
def return_filter(self, name, npoints):
"""Mid return filter test"""
self.assertModule('v.in.pdal', input=self.las_file,
@@ -106,18 +109,22 @@
vector=self.imported_points,
reference=dict(points=npoints))
+ @unittest.skipIf(shutil_which('v.in.pdal') is None, "Cannot find v.in.pdal")
def test_first_return_filter(self):
"""First return filter test"""
self.return_filter('first', 9)
+ @unittest.skipIf(shutil_which('v.in.pdal') is None, "Cannot find v.in.pdal")
def test_mid_return_filter(self):
"""Mid return filter test"""
self.return_filter('mid', 5)
+ @unittest.skipIf(shutil_which('v.in.pdal') is None, "Cannot find v.in.pdal")
def test_last_return_filter(self):
"""Last return filter test"""
self.return_filter('last', 5)
+ @unittest.skipIf(shutil_which('v.in.pdal') is None, "Cannot find v.in.pdal")
def class_filter(self, class_n, npoints):
"""Actual code for testing class filter"""
self.assertModule('v.in.pdal', input=self.las_file,
@@ -128,22 +135,27 @@
vector=self.imported_points,
reference=dict(points=npoints))
+ @unittest.skipIf(shutil_which('v.in.pdal') is None, "Cannot find v.in.pdal")
def test_class_2_filter(self):
"""Test to filter classes"""
self.class_filter(2, 2)
+ @unittest.skipIf(shutil_which('v.in.pdal') is None, "Cannot find v.in.pdal")
def test_class_3_filter(self):
"""Test to filter classes"""
self.class_filter(3, 5)
+ @unittest.skipIf(shutil_which('v.in.pdal') is None, "Cannot find v.in.pdal")
def test_class_4_filter(self):
"""Test to filter classes"""
self.class_filter(4, 4)
+ @unittest.skipIf(shutil_which('v.in.pdal') is None, "Cannot find v.in.pdal")
def test_class_5_filter(self):
"""Test to filter classes"""
self.class_filter(5, 8)
+ @unittest.skipIf(shutil_which('v.in.pdal') is None, "Cannot find v.in.pdal")
def return_and_class_filter(self, return_name, class_n, npoints):
"""Return and class filter combined test code"""
self.assertModule('v.in.pdal', input=self.las_file,
@@ -154,14 +166,17 @@
vector=self.imported_points,
reference=dict(points=npoints))
+ @unittest.skipIf(shutil_which('v.in.pdal') is None, "Cannot find v.in.pdal")
def test_first_return_and_class_filter(self):
"""Combined test for return and class"""
self.return_and_class_filter('first', 2, 2)
+ @unittest.skipIf(shutil_which('v.in.pdal') is None, "Cannot find v.in.pdal")
def test_last_return_and_class_filter(self):
"""Combined test for return and class"""
self.return_and_class_filter('last', 5, 3)
+ @unittest.skipIf(shutil_which('v.in.pdal') is None, "Cannot find v.in.pdal")
def zrange_filter(self, zrange, npoints):
"""Actual code for zrange option test"""
self.assertModule('v.in.pdal', input=self.las_file,
@@ -172,10 +187,12 @@
vector=self.imported_points,
reference=dict(points=npoints))
+ @unittest.skipIf(shutil_which('v.in.pdal') is None, "Cannot find v.in.pdal")
def test_zrange_filter(self):
"""Test zrange option"""
self.zrange_filter((130.1, 139.9), 3)
+ @unittest.skipIf(shutil_which('v.in.pdal') is None, "Cannot find v.in.pdal")
def test_non_int_zrange_filter(self):
"""Test zrange option with float number
@@ -183,6 +200,7 @@
"""
self.zrange_filter((140.5, 900), 8)
+ @unittest.skipIf(shutil_which('v.in.pdal') is None, "Cannot find v.in.pdal")
def test_zrange_and_class_filter(self):
"""zrange and class_filter option combined test"""
self.assertModule('v.in.pdal', input=self.las_file,
@@ -193,6 +211,7 @@
vector=self.imported_points,
reference=dict(points=4))
+ @unittest.skipIf(shutil_which('v.in.pdal') is None, "Cannot find v.in.pdal")
def test_zrange_and_return_filter(self):
"""zrange and class_filter option combined test"""
self.assertModule('v.in.pdal', input=self.las_file,
More information about the grass-commit
mailing list