aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGravatar rcoh <rcoh@mit.edu>2011-02-16 15:26:29 -0500
committerGravatar rcoh <rcoh@mit.edu>2011-02-16 15:26:29 -0500
commit3c405fa182b1e524f5724e65266667d8f65dc179 (patch)
tree2e1320d152f4ae8579eb8f651be0af12da25c6cb /tests
parentd8ba03006e2ea1400e80caded738e79c186e8de3 (diff)
parentf34e1c732036553e4a68534dfc1b24a13ccd33ce (diff)
Merge branch 'master' into behavior-factory
Diffstat (limited to 'tests')
-rw-r--r--tests/TestBQS.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/TestBQS.py b/tests/TestBQS.py
index 7316c31..c46b917 100644
--- a/tests/TestBQS.py
+++ b/tests/TestBQS.py
@@ -13,13 +13,16 @@ class TestBQS(unittest.TestCase):
c.addInput({'Location':(5,12)})
b.timeStep()
c.timeStep()
+
def tearDown(self):
bqs.initBQS()
+
def test_simple_query(self):
validQuery = lambda args:args['Color']==(255,0,0)
invalidQuery = lambda args:args['Color']==(254,0,0)
assert bqs.query(validQuery) == [{'Color':(255,0,0), 'Location':(3,4)}]
assert bqs.query(invalidQuery) == []
+
def test_dist_query(self):
validDist = lambda args:geo.dist(args['Location'], (0,0)) <= 5
invalidDist = lambda args:geo.dist(args['Location'], (0,0)) <= 2
@@ -30,7 +33,6 @@ class TestBQS(unittest.TestCase):
assert bqs.query(doubleDist) == [{'Color':(255,0,0), 'Location':(3,4)}, {'Color':(0,0,255),\
'Location':(5,12)}]
def test_complex_queries(self):
-
validQuery = lambda args:args['Color']==(255,0,0)
doubleDist = lambda args:geo.dist(args['Location'], (0,0)) <= 20