From da06dd1e290a4efb1d6f1c429b0f54f3e2ed9b50 Mon Sep 17 00:00:00 2001 From: Anna Petrasova Date: Fri, 5 Jan 2024 09:10:03 -0500 Subject: [PATCH] r.contour: remove broken test (#3333) --- .github/workflows/macos_gunittest.cfg | 1 - .gunittest.cfg | 1 - .../docs/src/gunittest_running_tests.rst | 2 +- raster/r.contour/testsuite/testrc.py | 120 ------------------ 4 files changed, 1 insertion(+), 123 deletions(-) delete mode 100644 raster/r.contour/testsuite/testrc.py diff --git a/.github/workflows/macos_gunittest.cfg b/.github/workflows/macos_gunittest.cfg index 9a124d438a5..65c839474c1 100644 --- a/.github/workflows/macos_gunittest.cfg +++ b/.github/workflows/macos_gunittest.cfg @@ -16,7 +16,6 @@ exclude = python/grass/script/testsuite/test_script_doctests.py python/grass/temporal/testsuite/unittests_temporal_raster_algebra_equal_ts.py python/grass/temporal/testsuite/unittests_temporal_raster_conditionals_complement_else.py - raster/r.contour/testsuite/testrc.py raster/r.in.gdal/testsuite/test_r_in_gdal.py raster/r.in.lidar/testsuite/test_base_resolution.sh raster/r.in.lidar/testsuite/test_base_resolution.sh diff --git a/.gunittest.cfg b/.gunittest.cfg index d68237e12fe..19c2cc950dd 100644 --- a/.gunittest.cfg +++ b/.gunittest.cfg @@ -16,7 +16,6 @@ exclude = python/grass/script/testsuite/test_script_doctests.py python/grass/temporal/testsuite/unittests_temporal_raster_algebra_equal_ts.py python/grass/temporal/testsuite/unittests_temporal_raster_conditionals_complement_else.py - raster/r.contour/testsuite/testrc.py raster/r.in.gdal/testsuite/test_r_in_gdal.py raster/r.in.lidar/testsuite/test_base_resolution.sh raster/r.in.lidar/testsuite/test_base_resolution.sh diff --git a/python/grass/docs/src/gunittest_running_tests.rst b/python/grass/docs/src/gunittest_running_tests.rst index 2e6e402835a..93f99cc93fb 100644 --- a/python/grass/docs/src/gunittest_running_tests.rst +++ b/python/grass/docs/src/gunittest_running_tests.rst @@ -100,7 +100,7 @@ you would use:: [gunittest] exclude = vector/* - raster/r.contour/testsuite/testrc.py + raster/r.contour/testsuite/test_broken.py Running tests and creating report diff --git a/raster/r.contour/testsuite/testrc.py b/raster/r.contour/testsuite/testrc.py deleted file mode 100644 index 89e1b685c67..00000000000 --- a/raster/r.contour/testsuite/testrc.py +++ /dev/null @@ -1,120 +0,0 @@ -""" -Name: r.contour test -Purpose: Tests r.contour and its flags/options. - -Author: Sunveer Singh, Google Code-in 2018 -Copyright: (C) 2018 by Sunveer Singh and the GRASS Development Team -Licence: This program is free software under the GNU General Public - License (>=v2). Read the file COPYING that comes with GRASS - for details. -""" -from grass.gunittest.case import TestCase -from grass.gunittest.main import test -from grass.gunittest.gmodules import SimpleModule - -out_where = """cat|level -1|56 -2|58 -3|60 -4|62 -5|64 -6|66 -7|68 -8|70 -9|72 -10|74 -11|76 -12|78 -13|80 -14|82 -15|84 -16|86 -17|88 -18|90 -19|92 -20|94 -21|96 -22|98 -23|100 -24|102 -25|104 -26|106 -27|108 -28|110 -29|112 -30|114 -31|116 -32|118 -33|120 -34|122 -35|124 -36|126 -37|128 -38|130 -39|132 -40|134 -41|136 -42|138 -43|140 -44|142 -45|144 -46|146 -47|148 -48|150 -49|152 -50|154 -51|156 -""" - - -class Testrr(TestCase): - input = "elevation" - output = "towns" - - @classmethod - def setUpClass(cls): - cls.use_temp_region() - cls.runModule("g.region", raster=cls.input) - - @classmethod - def tearDownClass(cls): - cls.del_temp_region() - - def tearDown(cls): - cls.runModule("g.remove", type="vector", flags="f", name=cls.output) - - def test_flag_t(self): - """Testing flag t""" - string = """min=1 - max=6""" - self.assertModule( - "r.contour", - input=self.input, - output=self.output, - levels=1, - step=1, - flags="t", - ) - self.assertRasterFitsUnivar(self.output, reference=string, precision=2) - - def test_vector(self): - """Testing vector output""" - self.assertModule( - "r.contour", input=self.input, output=self.output, step=5, flags="t" - ) - self.assertModule("v.info", map=self.output, flags="t") - topology = dict(points=0, lines=2222, areas=0) - self.assertVectorFitsTopoInfo(self.output, topology) - - def test_v_db_select(self): - """Testing attribute values of contours with v.db.select""" - self.assertModule("r.contour", input=self.input, output=self.output, step=2) - v_db_select = SimpleModule("v.db.select", map=self.output) - v_db_select.run() - self.assertLooksLike(reference=out_where, actual=v_db_select.outputs.stdout) - - -if __name__ == "__main__": - from grass.gunittest.main import test - - test()