[GRASS-SVN] r54689 - grass-addons/grass7/raster/r.agent/tests

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jan 17 14:33:40 PST 2013


Author: mic
Date: 2013-01-17 14:33:40 -0800 (Thu, 17 Jan 2013)
New Revision: 54689

Modified:
   grass-addons/grass7/raster/r.agent/tests/test_grassland.py
   grass-addons/grass7/raster/r.agent/tests/test_playground.py
Log:
cleanup tests

Modified: grass-addons/grass7/raster/r.agent/tests/test_grassland.py
===================================================================
--- grass-addons/grass7/raster/r.agent/tests/test_grassland.py	2013-01-17 22:27:15 UTC (rev 54688)
+++ grass-addons/grass7/raster/r.agent/tests/test_grassland.py	2013-01-17 22:33:40 UTC (rev 54689)
@@ -3,13 +3,16 @@
 #import unittest
 
 from libagent import playground, grassland
+import grass.script as grass
+from grass.script import array as garray
 
-class TestOurExceptions(unittest.TestCase):
+class TestGrassLand(unittest.TestCase):
     def setUp(self):              
         self.pg = grassland.GrassLand()
 
     def test_getregion(self):
         self.assertIsNotNone(self.pg.getregion())
+        self.assertEqual(self.pg.getregion(),grass.region())
 
     def test_getbound(self):
         n = self.pg.region["n"]
@@ -45,9 +48,8 @@
         self.assertEqual(len(self.pg.layers["foo"]), self.pg.region["rows"])
         self.assertEqual(len(self.pg.layers["foo"][0]), self.pg.region["cols"])
 
-    def test_getlayer(self):
-        self.pg.layers["foo"] = [0]
-        self.assertIs(self.pg.layers["foo"], self.pg.getlayer("foo"))
+    #def test_getlayer(self):
+       # gets tested in createlayer and super()/Playground
 
     def test_removelayer(self):
         self.pg.layers["foo"] = [0]

Modified: grass-addons/grass7/raster/r.agent/tests/test_playground.py
===================================================================
--- grass-addons/grass7/raster/r.agent/tests/test_playground.py	2013-01-17 22:27:15 UTC (rev 54688)
+++ grass-addons/grass7/raster/r.agent/tests/test_playground.py	2013-01-17 22:33:40 UTC (rev 54689)
@@ -4,12 +4,13 @@
 
 from libagent import playground, error
 
-class TestOurExceptions(unittest.TestCase):
+class TestPlayground(unittest.TestCase):
     def setUp(self):
         self.pg = playground.Playground()
 
     def test_getregion(self):
         self.assertIsNotNone(self.pg.getregion())
+        self.assertIs(self.pg.getregion(),self.pg.region)
 
     def test_getbound(self):
         n = self.pg.region["n"]



More information about the grass-commit mailing list