python/tests/test_sink.py: trivial test for sink 'with' interface (PEP 343)
authorPaul Brossier <piem@piem.org>
Tue, 28 Feb 2017 00:32:25 +0000 (01:32 +0100)
committerPaul Brossier <piem@piem.org>
Tue, 28 Feb 2017 00:32:25 +0000 (01:32 +0100)
python/tests/test_sink.py

index 6defbcf..c31564a 100755 (executable)
@@ -116,5 +116,12 @@ class aubio_sink_test_case(TestCase):
         g.close()
         del_tmp_sink_path(sink_path)
 
         g.close()
         del_tmp_sink_path(sink_path)
 
+    def test_read_with(self):
+        sink_path =get_tmp_sink_path()
+        vec = fvec(128)
+        with sink(sink_path, samplerate) as g:
+            for i in range(10):
+                g(vec, 128)
+
 if __name__ == '__main__':
     main()
 if __name__ == '__main__':
     main()