Changeset 25e0b0e for python/tests


Ignore:
Timestamp:
Mar 27, 2017, 10:34:57 AM (7 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, sampler
Children:
93579e5
Parents:
b31a91c
Message:

python/tests/test_onset.py: simply check that threshold, minioi and delay are > 0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/tests/test_onset.py

    rb31a91c r25e0b0e  
    2020
    2121    def test_get_delay(self):
    22         assert_equal (self.o.get_delay(), int(4.3 * self.o.hop_size))
     22        self.assertGreater(self.o.get_delay(), 0)
    2323
    2424    def test_get_delay_s(self):
    25         assert_almost_equal (self.o.get_delay_s(), self.o.get_delay() / float(self.samplerate))
     25        self.assertGreater(self.o.get_delay_s(), 0.)
    2626
    2727    def test_get_delay_ms(self):
    28         assert_almost_equal (self.o.get_delay_ms(), self.o.get_delay() * 1000. / self.samplerate, 5)
     28        self.assertGreater(self.o.get_delay_ms(), 0.)
    2929
    3030    def test_get_minioi(self):
    31         assert_almost_equal (self.o.get_minioi(), 0.02 * self.samplerate)
     31        self.assertGreater(self.o.get_minioi(), 0)
    3232
    3333    def test_get_minioi_s(self):
    34         assert_almost_equal (self.o.get_minioi_s(), 0.02)
     34        self.assertGreater(self.o.get_minioi_s(), 0.)
    3535
    3636    def test_get_minioi_ms(self):
    37         assert_equal (self.o.get_minioi_ms(), 20.)
     37        self.assertGreater(self.o.get_minioi_ms(), 0.)
    3838
    3939    def test_get_threshold(self):
    40         assert_almost_equal (self.o.get_threshold(), 0.3)
     40        self.assertGreater(self.o.get_threshold(), 0.)
    4141
    4242    def test_set_delay(self):
Note: See TracChangeset for help on using the changeset viewer.