summaryrefslogtreecommitdiff
path: root/tests/stats_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/stats_test.py')
-rw-r--r--tests/stats_test.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/stats_test.py b/tests/stats_test.py
new file mode 100644
index 0000000..9d937e9
--- /dev/null
+++ b/tests/stats_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 StatsTest(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.get_stats_xml()
+
+if __name__ == '__main__':
+ unittest.main()