summaryrefslogtreecommitdiff
path: root/gr-blocks/python
diff options
context:
space:
mode:
Diffstat (limited to 'gr-blocks/python')
-rwxr-xr-xgr-blocks/python/qa_type_conversions.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/gr-blocks/python/qa_type_conversions.py b/gr-blocks/python/qa_type_conversions.py
index 7c27a9c51..1faf83ad8 100755
--- a/gr-blocks/python/qa_type_conversions.py
+++ b/gr-blocks/python/qa_type_conversions.py
@@ -106,6 +106,16 @@ class test_type_conversions(gr_unittest.TestCase):
self.tb.run()
self.assertFloatTuplesAlmostEqual(expected_data, dst.data())
+ def test_complex_to_imag(self):
+ src_data = (1+2j, 3+4j, 5+6j, 7+8j, 9+10j)
+ expected_data = (2.0, 4.0, 6.0, 8.0, 10.0)
+ src = gr.vector_source_c(src_data)
+ op = blocks_swig.complex_to_imag()
+ dst = gr.vector_sink_f()
+ self.tb.connect(src, op, dst)
+ self.tb.run()
+ self.assertFloatTuplesAlmostEqual(expected_data, dst.data())
+
if __name__ == '__main__':
gr_unittest.run(test_type_conversions, "test_type_conversions.xml")