[GRASS-SVN] r55663 - grass-addons/grass7/raster/r.agent
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Apr 8 06:58:16 PDT 2013
Author: mic
Date: 2013-04-08 06:58:15 -0700 (Mon, 08 Apr 2013)
New Revision: 55663
Removed:
grass-addons/grass7/raster/r.agent/r.agent.tests.py
Log:
remove main file for the old test suite
Deleted: grass-addons/grass7/raster/r.agent/r.agent.tests.py
===================================================================
--- grass-addons/grass7/raster/r.agent/r.agent.tests.py 2013-04-08 13:54:47 UTC (rev 55662)
+++ grass-addons/grass7/raster/r.agent/r.agent.tests.py 2013-04-08 13:58:15 UTC (rev 55663)
@@ -1,79 +0,0 @@
-#!/usr/bin/env python
-
-def dotest(function, argv):
- """Global wrapper for the individual test suits."""
- while True:
- n = function.func_doc
- o = str(argv)
- if not n:
- n = str(function)
- t = str(raw_input("execute this now: '"+n+" - "+o+"'? [y/n/abort] "))
- if t == "y":
- if argv != None:
- function(*argv)
- else:
- function()
- break
- elif t == "n":
- break
- elif t == "abort":
- exit()
-
-def testPlayground():
- """Test suite for Class: Playground"""
- pg = playground.Playground()
-
- print(pg.region)
-
-def testWorld():
- """Test suite for Class: World"""
- w = world.World()
-
-def testACO():
- """Test suite for World-Class: ACO"""
- w = aco.ACO()
-
-def testAgent(ttl):
- """Test suite for Class: Agent"""
- w = world.World()
- w = agent.Agent(ttl, w)
-
-def testAnt(ttl, position):
- """Test suite for Agent-Class: Ant"""
- w = world.World()
- w = ant.Ant(ttl, w, position)
-
-if __name__ == "__main__":
- """Main method for testing when run as a script."""
- import sys
- import os
-
- from libagent import error
-
- if os.environ.get("GISBASE") == None:
- raise error.EnvError("r.agent::TestSuite", "Please run inside GRASS.")
-
- from libagent import playground
- from libagent import world
- from libagent import aco
- from libagent import agent
- from libagent import ant
-
- alltests = {"playground":[testPlayground, []],
- "world":[testWorld, []],
- "aco":[testACO, []],
- "Agent":[testAgent, [1]],
- "Ant":[testAnt, [1, []]]}
-
- if len(sys.argv) == 1:
- for test,details in alltests.iteritems():
- dotest(details[0], details[1])
- else:
- sys.argv.pop(0)
- for t in sys.argv:
- if t in alltests:
- dotest(*alltests[t])
- else:
- print("Test does not exist: ", t)
-
-
More information about the grass-commit
mailing list