[GRASS-SVN] r56380 - grass-addons/grass7/raster/r.agent/tests
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu May 23 08:16:24 PDT 2013
Author: mic
Date: 2013-05-23 08:16:24 -0700 (Thu, 23 May 2013)
New Revision: 56380
Modified:
grass-addons/grass7/raster/r.agent/tests/test_ant.py
Log:
add test for walkhome
Modified: grass-addons/grass7/raster/r.agent/tests/test_ant.py
===================================================================
--- grass-addons/grass7/raster/r.agent/tests/test_ant.py 2013-05-23 14:42:41 UTC (rev 56379)
+++ grass-addons/grass7/raster/r.agent/tests/test_ant.py 2013-05-23 15:16:24 UTC (rev 56380)
@@ -37,7 +37,14 @@
def test_walkhome(self):
#TODO walking home
- pass
+ self.agent.nextstep = [0,0,0,0]
+ self.agent.laststeps = [[1,1,0,0], [0,1,0,0]]
+ self.agent.walkhome()
+ self.assertEqual(self.world.pathintensity,
+ self.pg.layers[anthill.Anthill.RESULT][0][0])
+ self.assertEqual([[1,1,0,0]], self.agent.laststeps)
+ self.agent.walkhome()
+ self.assertEqual(0, len(self.world.agents))
def test_walkaround(self):
self.agent.position = [0,0]
More information about the grass-commit
mailing list