ref: 25e0b0ef3ece7bc6787900053b549ee896eb65c1
parent: b31a91c1c720445de742fd039b7ba491011b3e65
author: Paul Brossier <piem@piem.org>
date: Mon Mar 27 06:34:57 EDT 2017
python/tests/test_onset.py: simply check that threshold, minioi and delay are > 0
--- a/python/tests/test_onset.py
+++ b/python/tests/test_onset.py
@@ -19,25 +19,25 @@
self.o = onset(samplerate = self.samplerate)
def test_get_delay(self):
- assert_equal (self.o.get_delay(), int(4.3 * self.o.hop_size))
+ self.assertGreater(self.o.get_delay(), 0)
def test_get_delay_s(self):
- assert_almost_equal (self.o.get_delay_s(), self.o.get_delay() / float(self.samplerate))
+ self.assertGreater(self.o.get_delay_s(), 0.)
def test_get_delay_ms(self):
- assert_almost_equal (self.o.get_delay_ms(), self.o.get_delay() * 1000. / self.samplerate, 5)
+ self.assertGreater(self.o.get_delay_ms(), 0.)
def test_get_minioi(self):
- assert_almost_equal (self.o.get_minioi(), 0.02 * self.samplerate)
+ self.assertGreater(self.o.get_minioi(), 0)
def test_get_minioi_s(self):
- assert_almost_equal (self.o.get_minioi_s(), 0.02)
+ self.assertGreater(self.o.get_minioi_s(), 0.)
def test_get_minioi_ms(self):
- assert_equal (self.o.get_minioi_ms(), 20.)
+ self.assertGreater(self.o.get_minioi_ms(), 0.)
def test_get_threshold(self):
- assert_almost_equal (self.o.get_threshold(), 0.3)
+ self.assertGreater(self.o.get_threshold(), 0.)
def test_set_delay(self):
val = 256