Index: python/tests/test_zero_crossing_rate.py
===================================================================
--- python/tests/test_zero_crossing_rate.py	(revision 969bbb20ff4e07e532467511340ceac481c52bd2)
+++ python/tests/test_zero_crossing_rate.py	(revision 969bbb20ff4e07e532467511340ceac481c52bd2)
@@ -0,0 +1,51 @@
+from aubio import fvec, zero_crossing_rate
+
+#! /usr/bin/env python
+
+from numpy.testing import TestCase
+
+buf_size = 2048
+
+class zero_crossing_rate_test_case(TestCase):
+
+    def setUp(self):
+        self.vector = fvec(buf_size)
+
+    def test(self):
+        """ create and delete fvec """
+        pass
+
+    def test_zeroes(self):
+        """ check zero crossing rate on a buffer of 0. """
+        self.assertEqual(0., zero_crossing_rate(self.vector))
+
+    def test_ones(self):
+        """ check zero crossing rate on a buffer of 1. """
+        self.vector[:] = 1.
+        self.assertEqual(0., zero_crossing_rate(self.vector))
+
+    def test_impulse(self):
+        """ check zero crossing rate on a buffer with an impulse """
+        self.vector[buf_size / 2] = 1.
+        self.assertEqual(0., zero_crossing_rate(self.vector))
+
+    def test_negative_impulse(self):
+        """ check zero crossing rate on a buffer with a negative impulse """
+        self.vector[buf_size / 2] = -1.
+        self.assertEqual(2./buf_size, zero_crossing_rate(self.vector))
+
+    def test_single(self):
+        """ check zero crossing rate on single crossing """
+        self.vector[buf_size / 2 - 1] = 1.
+        self.vector[buf_size / 2] = -1.
+        self.assertEqual(2./buf_size, zero_crossing_rate(self.vector))
+
+    def test_single_with_gap(self):
+        """ check zero crossing rate on single crossing with a gap"""
+        self.vector[buf_size / 2 - 2] = 1.
+        self.vector[buf_size / 2] = -1.
+        self.assertEqual(2./buf_size, zero_crossing_rate(self.vector))
+
+if __name__ == '__main__':
+    from unittest import main
+    main()
Index: thon/tests/test_zero_crossing_rate.py.old
===================================================================
--- python/tests/test_zero_crossing_rate.py.old	(revision 018e5110b0792482466b26fa112ade7a0cc9e826)
+++ 	(revision )
@@ -1,56 +1,0 @@
-from aubio import zero_crossing_rate
-
-#! /usr/bin/env python
-
-from numpy.testing import TestCase
-
-buf_size = 2048
-channels = 1
-
-class zero_crossing_rate_test_case(TestCase):
-
-  def setUp(self):
-    self.vector = new_fvec(buf_size, channels)
-
-  def tearDown(self):
-    del_fvec(self.vector)
-
-  def test(self):
-    """ create and delete fvec """
-    pass
-
-  def test_zeroes(self):
-    """ check zero crossing rate on a buffer of 0. """
-    self.assertEqual(0., zero_crossing_rate(self.vector))
-
-  def test_ones(self):
-    """ check zero crossing rate on a buffer of 1. """
-    for index in range(buf_size):
-      for channel in range(channels):
-        fvec_write_sample(self.vector, 1., channel, index)
-    self.assertEqual(0., zero_crossing_rate(self.vector))
-
-  def test_impulse(self):
-    """ check zero crossing rate on a buffer with an impulse """
-    fvec_write_sample(self.vector, 1., 0, buf_size / 2)
-    self.assertEqual(0., zero_crossing_rate(self.vector))
-
-  def test_negative_impulse(self):
-    """ check zero crossing rate on a buffer with a negative impulse """
-    fvec_write_sample(self.vector, -1., 0, buf_size / 2)
-    self.assertEqual(2./buf_size, zero_crossing_rate(self.vector))
-
-  def test_single(self):
-    """ check zero crossing rate on single crossing """
-    fvec_write_sample(self.vector, +1., 0, buf_size / 2 - 1)
-    fvec_write_sample(self.vector, -1., 0, buf_size / 2)
-    self.assertEqual(2./buf_size, zero_crossing_rate(self.vector))
-
-  def test_single_with_gap(self):
-    """ check zero crossing rate on single crossing with a gap"""
-    fvec_write_sample(self.vector, +1., 0, buf_size / 2 - 2)
-    fvec_write_sample(self.vector, -1., 0, buf_size / 2)
-    self.assertEqual(2./buf_size, zero_crossing_rate(self.vector))
-
-if __name__ == '__main__':
-  unittest.main()
