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

svn_grass at osgeo.org svn_grass at osgeo.org
Sat May 18 04:18:28 PDT 2013


Author: mic
Date: 2013-05-18 04:18:28 -0700 (Sat, 18 May 2013)
New Revision: 56293

Modified:
   grass-addons/grass7/raster/r.agent/tests/test_anthill.py
Log:
start testing anthill

Modified: grass-addons/grass7/raster/r.agent/tests/test_anthill.py
===================================================================
--- grass-addons/grass7/raster/r.agent/tests/test_anthill.py	2013-05-18 11:17:05 UTC (rev 56292)
+++ grass-addons/grass7/raster/r.agent/tests/test_anthill.py	2013-05-18 11:18:28 UTC (rev 56293)
@@ -2,11 +2,14 @@
 import unittest2 as unittest
 #import unittest
 
-from libagent import anthill
+from libagent import playground, anthill
 
 class TestAnthill(unittest.TestCase):
     def setUp(self):
-        self.world = anthill.Anthill()
+        self.pg = playground.Playground()
+        self.pg.setregion(3,3)
+        self.world = anthill.Anthill(self.pg)
+        self.world.sites = [[1,1]]
 
     def test_addlayertopg(self):
         # gets tested in World
@@ -25,7 +28,10 @@
         pass
 
     def test_bear(self):
-        pass
+        agent = self.world.bear()
+        self.assertIsInstance(agent, self.world.agenttype)
+        self.assertIs(agent, self.world.agents.pop())
+        self.assertEqual(0, len(self.world.agents))
 
     def test_move(self):
         # gets tested in World



More information about the grass-commit mailing list