From: Paul Brossier Date: Mon, 27 Mar 2017 08:34:57 +0000 (+0200) Subject: python/tests/test_onset.py: simply check that threshold, minioi and delay are > 0 X-Git-Tag: 0.4.5~20^2~4 X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=25e0b0ef3ece7bc6787900053b549ee896eb65c1;p=aubio.git python/tests/test_onset.py: simply check that threshold, minioi and delay are > 0 --- diff --git a/python/tests/test_onset.py b/python/tests/test_onset.py index dcb6dabc..8b5f7ba3 100755 --- a/python/tests/test_onset.py +++ b/python/tests/test_onset.py @@ -19,25 +19,25 @@ class aubio_onset_params(TestCase): 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