From b62b2f984077c42678223ca2f6301aea50fe7d65 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 27 Mar 2013 04:00:21 -0500 Subject: gras: also rename and fix the stats test to query --- tests/query_test.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tests/query_test.py (limited to 'tests/query_test.py') 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() -- cgit