Changeset 208336b


Ignore:
Timestamp:
Mar 5, 2013, 8:55:29 AM (12 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
Children:
ad5203c
Parents:
f50e534
Message:

tests/python/: removed old python tests

Files:
12 deleted
2 moved

Legend:

Unmodified
Added
Removed
  • python/tests/test_hist.py.old

    rf50e534 r208336b  
    1 from template import aubio_unit_template
    2 from localaubio import *
     1#! /usr/bin/env python
     2
     3from numpy.testing import TestCase, assert_equal, assert_almost_equal
     4from aubio import fvec, digital_filter
    35import random
    46
     
    1012nelems = 1000
    1113
    12 class hist_unit(aubio_unit_template):
     14class hist_test_case(TestCase):
    1315
    1416  def setUp(self):
     
    6365    """ test hist on constant under lower limit """
    6466    """ this returns 0 because constant is out of range """
    65     input = new_fvec(buf_size, channels)
     67    vec_in = fvec(buf_size)
    6668    constant = flow - 1.
    67     fvec_write_sample(input,constant,0,0)
     69    vec_in[0] = constant
    6870    aubio_hist_do_notnull(self.o, input)
    6971    self.assertCloseEnough(0., aubio_hist_mean(self.o))
  • python/tests/test_zero_crossing_rate.py.old

    rf50e534 r208336b  
    1 from template import aubio_unit_template
    2 from localaubio import *
     1from aubio import zero_crossing_rate
     2
     3#! /usr/bin/env python
     4
     5from numpy.testing import TestCase
    36
    47buf_size = 2048
    58channels = 1
    69
    7 class zero_crossing_rate_unit(unittest.TestCase):
     10class zero_crossing_rate_test_case(TestCase):
    811
    912  def setUp(self):
     
    1922  def test_zeroes(self):
    2023    """ check zero crossing rate on a buffer of 0. """
    21     self.assertEqual(0., aubio_zero_crossing_rate(self.vector))
     24    self.assertEqual(0., zero_crossing_rate(self.vector))
    2225
    2326  def test_ones(self):
     
    2629      for channel in range(channels):
    2730        fvec_write_sample(self.vector, 1., channel, index)
    28     self.assertEqual(0., aubio_zero_crossing_rate(self.vector))
     31    self.assertEqual(0., zero_crossing_rate(self.vector))
    2932
    3033  def test_impulse(self):
    3134    """ check zero crossing rate on a buffer with an impulse """
    3235    fvec_write_sample(self.vector, 1., 0, buf_size / 2)
    33     self.assertEqual(0., aubio_zero_crossing_rate(self.vector))
     36    self.assertEqual(0., zero_crossing_rate(self.vector))
    3437
    3538  def test_negative_impulse(self):
    3639    """ check zero crossing rate on a buffer with a negative impulse """
    3740    fvec_write_sample(self.vector, -1., 0, buf_size / 2)
    38     self.assertEqual(2./buf_size, aubio_zero_crossing_rate(self.vector))
     41    self.assertEqual(2./buf_size, zero_crossing_rate(self.vector))
    3942
    4043  def test_single(self):
     
    4245    fvec_write_sample(self.vector, +1., 0, buf_size / 2 - 1)
    4346    fvec_write_sample(self.vector, -1., 0, buf_size / 2)
    44     self.assertEqual(2./buf_size, aubio_zero_crossing_rate(self.vector))
     47    self.assertEqual(2./buf_size, zero_crossing_rate(self.vector))
    4548
    4649  def test_single_with_gap(self):
     
    4851    fvec_write_sample(self.vector, +1., 0, buf_size / 2 - 2)
    4952    fvec_write_sample(self.vector, -1., 0, buf_size / 2)
    50     self.assertEqual(2./buf_size, aubio_zero_crossing_rate(self.vector))
     53    self.assertEqual(2./buf_size, zero_crossing_rate(self.vector))
    5154
    5255if __name__ == '__main__':
Note: See TracChangeset for help on using the changeset viewer.