History

[tests] [py27] make sure all classes are old-school 'new-style'

Paul Brossier committed 8 years ago

Commit 8607a741 parent 67024ff6 files · +12 −12Browse files

Showing the changes to python (6 of 6 files). Show all

Unified · Split

6 files
  1. python/tests/test_mfcc.py +2 −2
  2. python/tests/test_midi2note.py +2 −2
  3. python/tests/test_note2midi.py +2 −2
  4. python/tests/test_phasevoc.py +1 −1
  5. python/tests/test_sink.py +1 −1
  6. python/tests/test_source.py +4 −4
python/tests/test_mfcc.py+2−2
@@ -14,7 +14,7 @@ samplerate = 44100 · 13 unmodified lines
14new_params = ['buf_size', 'n_filters', 'n_coeffs', 'samplerate']14new_params = ['buf_size', 'n_filters', 'n_coeffs', 'samplerate']
15new_deflts = [1024, 40, 13, 44100]15new_deflts = [1024, 40, 13, 44100]
16 16
17class Test_aubio_mfcc:17class Test_aubio_mfcc(object):
18 18
19 members_args = 'name'19 members_args = 'name'
20 20
@@ -74,7 +74,7 @@ class aubio_mfcc_compute(TestCase): · 53 unmodified lines
74 #print coeffs74 #print coeffs
75 75
76 76
77class Test_aubio_mfcc_all_parameters:77class Test_aubio_mfcc_all_parameters(object):
78 78
79 run_values = [79 run_values = [
80 (2048, 40, 13, 44100),80 (2048, 40, 13, 44100),
python/tests/test_midi2note.py+2−2
@@ -14,14 +14,14 @@ list_of_known_midis = ( · 13 unmodified lines
14 ( 127, 'G9' ),14 ( 127, 'G9' ),
15 )15 )
16 16
17class Test_midi2note_good_values:17class Test_midi2note_good_values(object):
18 18
19 @parametrize('midi, note', list_of_known_midis)19 @parametrize('midi, note', list_of_known_midis)
20 def test_midi2note_known_values(self, midi, note):20 def test_midi2note_known_values(self, midi, note):
21 " known values are correctly converted "21 " known values are correctly converted "
22 assert midi2note(midi) == (note)22 assert midi2note(midi) == (note)
23 23
24class Test_midi2note_wrong_values:24class Test_midi2note_wrong_values(object):
25 25
26 def test_midi2note_negative_value(self):26 def test_midi2note_negative_value(self):
27 " fails when passed a negative value "27 " fails when passed a negative value "
python/tests/test_note2midi.py+2−2
@@ -44,7 +44,7 @@ list_of_unknown_notes = ( · 43 unmodified lines
44 ( '2' ),44 ( '2' ),
45 )45 )
46 46
47class Test_note2midi_good_values:47class Test_note2midi_good_values(object):
48 48
49 @parametrize('note, midi', list_of_known_notes)49 @parametrize('note, midi', list_of_known_notes)
50 def test_note2midi_known_values(self, note, midi):50 def test_note2midi_known_values(self, note, midi):
@@ -107,7 +107,7 @@ class note2midi_wrong_values(TestCase): · 56 unmodified lines
107 " fails when passed a note with a note name longer than expected"107 " fails when passed a note with a note name longer than expected"
108 self.assertRaises(ValueError, note2midi, 'CB+-3')108 self.assertRaises(ValueError, note2midi, 'CB+-3')
109 109
110class Test_note2midi_unknown_values:110class Test_note2midi_unknown_values(object):
111 111
112 @parametrize('note', list_of_unknown_notes)112 @parametrize('note', list_of_unknown_notes)
113 def test_note2midi_unknown_values(self, note):113 def test_note2midi_unknown_values(self, note):
python/tests/test_phasevoc.py+1−1
@@ -17,7 +17,7 @@ def create_sine(hop_s, freq, samplerate): · 16 unmodified lines
17def create_noise(hop_s):17def create_noise(hop_s):
18 return np.random.rand(hop_s).astype(float_type) * 2. - 1.18 return np.random.rand(hop_s).astype(float_type) * 2. - 1.
19 19
20class Test_aubio_pvoc_test_case:20class Test_aubio_pvoc_test_case(object):
21 """ pvoc object test case """21 """ pvoc object test case """
22 22
23 def test_members_automatic_sizes_default(self):23 def test_members_automatic_sizes_default(self):
python/tests/test_sink.py+1−1
@@ -19,7 +19,7 @@ for soundfile in list_of_sounds: · 18 unmodified lines
19 for samplerate in samplerates:19 for samplerate in samplerates:
20 all_params.append((hop_size, samplerate, soundfile))20 all_params.append((hop_size, samplerate, soundfile))
21 21
22class Test_aubio_sink:22class Test_aubio_sink(object):
23 23
24 def test_wrong_filename(self):24 def test_wrong_filename(self):
25 with assert_raises(RuntimeError):25 with assert_raises(RuntimeError):
python/tests/test_source.py+4−4
@@ -23,7 +23,7 @@ no_sounds_msg = "no test sounds, add some in 'python/tests/sounds/'!" · 22 unmodified lines
23 23
24_debug = False24_debug = False
25 25
26class Test_aubio_source_test_case:26class Test_aubio_source_test_case(object):
27 27
28 @parametrize('filename', list_of_sounds)28 @parametrize('filename', list_of_sounds)
29 def test_close_file(self, filename):29 def test_close_file(self, filename):
@@ -40,7 +40,7 @@ class Test_aubio_source_test_case: · 10 unmodified lines
40 f.close()40 f.close()
41 f.close()41 f.close()
42 42
43class Test_aubio_source_read:43class Test_aubio_source_read(object):
44 44
45 def read_from_source(self, f):45 def read_from_source(self, f):
46 total_frames = 046 total_frames = 0
@@ -118,7 +118,7 @@ class Test_aubio_source_read: · 71 unmodified lines
118 assert_equal (duration, total_frames)118 assert_equal (duration, total_frames)
119 119
120 120
121class Test_aubio_source_wrong_params:121class Test_aubio_source_wrong_params(object):
122 122
123 def test_wrong_file(self):123 def test_wrong_file(self):
124 with assert_raises(RuntimeError):124 with assert_raises(RuntimeError):
@@ -171,7 +171,7 @@ class Test_aubio_source_readmulti(Test_aubio_source_read): · 46 unmodified lines
171 print (result_str.format(*result_params))171 print (result_str.format(*result_params))
172 return total_frames172 return total_frames
173 173
174class Test_aubio_source_with:174class Test_aubio_source_with(object):
175 175
176 @parametrize('filename', list_of_sounds)176 @parametrize('filename', list_of_sounds)
177 def test_read_from_mono(self, filename):177 def test_read_from_mono(self, filename):

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