Browse Source

v.unpack: added test

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@74233 15284696-431f-4ddb-bdfa-cd5b030d7da7
Luca Delucchi 6 years ago
parent
commit
cdff3e45ce
1 changed files with 38 additions and 0 deletions
  1. 38 0
      scripts/v.unpack/testsuite/test_v_unpack.py

+ 38 - 0
scripts/v.unpack/testsuite/test_v_unpack.py

@@ -0,0 +1,38 @@
+"""
+Created on Sun Jun 08 12:50:45 2018
+
+@author: Sanjeet Bhatti
+"""
+
+from grass.gunittest.case import TestCase
+from grass.gunittest.main import test
+from grass.gunittest.gmodules import SimpleModule
+
+import os
+
+
+class TestVUnpack(TestCase):
+    """Test v.unpack script"""
+
+    mapName = 'roadsmajor'
+    packFile = 'roadsmajor.pack'
+
+    @classmethod
+    def setUpClass(cls):
+        """Run v.pack to create packfile."""
+        cls.runModule('v.pack', input=cls.mapName, output=cls.packFile)
+
+    @classmethod
+    def tearDownClass(cls):
+        """Remove pack file created region"""
+        cls.runModule('g.remove', type='vector', name=cls.mapName, flags='f')
+        if (os.path.isfile(cls.packFile)):
+            os.remove(cls.packFile)
+
+    def test_v_pack(self):
+        """Unpack file test"""
+        module = SimpleModule('v.unpack', input=self.packFile, overwrite=True)
+        self.assertModule(module)
+
+if __name__ == '__main__':
+    test()