diff options
author | Josh Blum | 2013-03-27 04:00:21 -0500 |
---|---|---|
committer | Josh Blum | 2013-03-27 04:00:21 -0500 |
commit | b62b2f984077c42678223ca2f6301aea50fe7d65 (patch) | |
tree | d35b0f38cf981556026b4c7e6c35735ad78c6f35 /tests/query_test.py | |
parent | 479f626bd049b3237a4249ba95da788abc8de36e (diff) | |
download | sandhi-b62b2f984077c42678223ca2f6301aea50fe7d65.tar.gz sandhi-b62b2f984077c42678223ca2f6301aea50fe7d65.tar.bz2 sandhi-b62b2f984077c42678223ca2f6301aea50fe7d65.zip |
gras: also rename and fix the stats test to query
Diffstat (limited to 'tests/query_test.py')
-rw-r--r-- | tests/query_test.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/query_test.py b/tests/query_test.py new file mode 100644 index 0000000..0326d33 --- /dev/null +++ b/tests/query_test.py @@ -0,0 +1,28 @@ +# Copyright (C) by Josh Blum. See LICENSE.txt for licensing information. + +import unittest +import gras +import numpy +from demo_blocks import * + +class QueryTest(unittest.TestCase): + + def setUp(self): + self.tb = gras.TopBlock() + + def tearDown(self): + self.tb = None + + def test_simple(self): + vec_source = VectorSource(numpy.uint32, [0, 9, 8, 7, 6]) + vec_sink = VectorSink(numpy.uint32) + + self.tb.connect(vec_source, vec_sink) + self.tb.run() + + self.assertEqual(vec_sink.get_vector(), (0, 9, 8, 7, 6)) + + print self.tb.query("") + +if __name__ == '__main__': + unittest.main() |