[GRASS-SVN] r74238 - in grass/trunk/scripts/v.db.renamecolumn: . testsuite

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Mar 13 00:36:23 PDT 2019


Author: lucadelu
Date: 2019-03-13 00:36:23 -0700 (Wed, 13 Mar 2019)
New Revision: 74238

Added:
   grass/trunk/scripts/v.db.renamecolumn/testsuite/
   grass/trunk/scripts/v.db.renamecolumn/testsuite/test_v_db_renamecolumn.py
Log:
v.db.renamecolumn: added test, thanks to Sanjeet Bhatti

Added: grass/trunk/scripts/v.db.renamecolumn/testsuite/test_v_db_renamecolumn.py
===================================================================
--- grass/trunk/scripts/v.db.renamecolumn/testsuite/test_v_db_renamecolumn.py	                        (rev 0)
+++ grass/trunk/scripts/v.db.renamecolumn/testsuite/test_v_db_renamecolumn.py	2019-03-13 07:36:23 UTC (rev 74238)
@@ -0,0 +1,41 @@
+"""
+Created on Sun Jun 07 19:08:34 2018
+
+ at author: Sanjeet Bhatti
+"""
+
+from grass.gunittest.case import TestCase
+from grass.gunittest.main import test
+from grass.gunittest.gmodules import SimpleModule
+
+from grass.script.core import run_command
+from grass.script.utils import decode
+
+
+class TestVDbRenameColumn(TestCase):
+    """Test v.db.renamecolumn script"""
+
+    @classmethod
+    def setUpClass(cls):
+        """Copy vector."""
+        run_command('g.copy', vector='roadsmajor,myroads')
+
+    @classmethod
+    def tearDownClass(cls):
+        """Remove copied vector"""
+        run_command('g.remove', type='vector', name='myroads',
+                    flags='f')
+
+    def test_rename_column(self):
+        """Renaming a column"""
+        module = SimpleModule('v.db.renamecolumn', map='myroads',
+                              column=('ROAD_NAME', 'roadname'))
+        self.assertModule(module)
+
+        m = SimpleModule('v.info', flags='c', map='myroads')
+        self.assertModule(m)
+        self.assertRegexpMatches(decode(m.outputs.stdout), 'roadname')
+        self.assertNotRegexpMatches(decode(m.outputs.stdout), 'ROAD_NAME')
+
+if __name__ == '__main__':
+    test()


Property changes on: grass/trunk/scripts/v.db.renamecolumn/testsuite/test_v_db_renamecolumn.py
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/x-python
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property


More information about the grass-commit mailing list