summaryrefslogtreecommitdiff
path: root/tests/query_test.py
diff options
context:
space:
mode:
authorJosh Blum2013-07-31 01:10:32 -0700
committerJosh Blum2013-07-31 01:10:32 -0700
commit20b413bce5c22bcc44bfc58105288df94a0a592d (patch)
treee4df40c82c89fda275ec36df42715b27b7a75708 /tests/query_test.py
parent79128f57c01a2453a71f9b0aa00d919c0a79666f (diff)
parent8fc35a79f138cc9c5d60affd20ca91767d16927f (diff)
downloadsandhi-20b413bce5c22bcc44bfc58105288df94a0a592d.tar.gz
sandhi-20b413bce5c22bcc44bfc58105288df94a0a592d.tar.bz2
sandhi-20b413bce5c22bcc44bfc58105288df94a0a592d.zip
Merge branch 'gras_tool3'
Diffstat (limited to 'tests/query_test.py')
-rw-r--r--tests/query_test.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/query_test.py b/tests/query_test.py
index 8e5bfaf..f4f45f9 100644
--- a/tests/query_test.py
+++ b/tests/query_test.py
@@ -3,7 +3,7 @@
import unittest
import gras
import numpy
-from demo_blocks import *
+from gras import TestUtils
class MyBlock(gras.Block):
def __init__(self):
@@ -44,13 +44,13 @@ class QueryTest(unittest.TestCase):
self.tb = None
def test_simple(self):
- vec_source = VectorSource(numpy.uint32, [0, 9, 8, 7, 6])
- vec_sink = VectorSink(numpy.uint32)
+ vec_source = TestUtils.VectorSource(numpy.uint32, [0, 9, 8, 7, 6])
+ vec_sink = TestUtils.VectorSink(numpy.uint32)
self.tb.connect(vec_source, vec_sink)
self.tb.run()
- self.assertEqual(vec_sink.get_vector(), (0, 9, 8, 7, 6))
+ self.assertEqual(vec_sink.data(), (0, 9, 8, 7, 6))
#query the block list
blocks_result = self.tb.query(dict(path="/blocks.json"))
@@ -71,8 +71,8 @@ class QueryTest(unittest.TestCase):
self.assertTrue(block_id in stats_result['blocks'])
def test_numeric_query(self):
- vec_source = VectorSource(numpy.uint32, [0, 9, 8, 7, 6])
- vec_sink = VectorSink(numpy.uint32)
+ vec_source = TestUtils.VectorSource(numpy.uint32, [0, 9, 8, 7, 6])
+ vec_sink = TestUtils.VectorSink(numpy.uint32)
block = MyBlock()
block.set_uid("test_numeric_query")
self.tb.connect(vec_source, block, vec_sink)
@@ -120,8 +120,8 @@ class QueryTest(unittest.TestCase):
self.assertEqual(result['value'], '(0,21)')
def test_vector_query(self):
- vec_source = VectorSource(numpy.uint32, [0, 9, 8, 7, 6])
- vec_sink = VectorSink(numpy.uint32)
+ vec_source = TestUtils.VectorSource(numpy.uint32, [0, 9, 8, 7, 6])
+ vec_sink = TestUtils.VectorSink(numpy.uint32)
block = MyBlock()
block.set_uid("test_vector_query")
self.tb.connect(vec_source, block, vec_sink)