History

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

Paul Brossier committed 9 years ago

Commit 25e0b0e1 parent b31a91c1 file · +7 −7Browse files

Showing the changes to python/tests (1 of 1 file). Show all

Unified · Split

python/tests/test_onset.py+7−7
@@ -19,25 +19,25 @@ class aubio_onset_params(TestCase): · 18 unmodified lines
19 self.o = onset(samplerate = self.samplerate)19 self.o = onset(samplerate = self.samplerate)
20 20
21 def test_get_delay(self):21 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)
23 23
24 def test_get_delay_s(self):24 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.)
26 26
27 def test_get_delay_ms(self):27 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.)
29 29
30 def test_get_minioi(self):30 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)
32 32
33 def test_get_minioi_s(self):33 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.)
35 35
36 def test_get_minioi_ms(self):36 def test_get_minioi_ms(self):
37 assert_equal (self.o.get_minioi_ms(), 20.)37 self.assertGreater(self.o.get_minioi_ms(), 0.)
38 38
39 def test_get_threshold(self):39 def test_get_threshold(self):
40 assert_almost_equal (self.o.get_threshold(), 0.3)40 self.assertGreater(self.o.get_threshold(), 0.)
41 41
42 def test_set_delay(self):42 def test_set_delay(self):
43 val = 25643 val = 256

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t