Changeset 8a49bb9 for python/tests
- Timestamp:
- Nov 30, 2016, 6:39:41 PM (8 years ago)
- 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, yinfft+
- Children:
- a0a073f
- Parents:
- 261836d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/tests/test_source.py
r261836d r8a49bb9 57 57 if read < f.hop_size: 58 58 assert_equal(samples[read:], 0) 59 if 'brownnoise' in f.uri:60 self.assertEquals(np.count_nonzero(samples[:read]), read)61 59 break 62 60 #result_str = "read {:.2f}s ({:d} frames in {:d} blocks at {:d}Hz) from {:s}" … … 72 70 self.skipTest('failed opening with hop_s = {:d}, samplerate = {:d} ({:s})'.format(hop_size, samplerate, str(e))) 73 71 assert f.samplerate != 0 74 self.read_from_source(f) 72 read_frames = self.read_from_source(f) 73 if 'f_' in soundfile and samplerate == 0: 74 import re 75 f = re.compile('.*_\([0:9]*f\)_.*') 76 match_f = re.findall('([0-9]*)f_', soundfile) 77 if len(match_f) == 1: 78 expected_frames = int(match_f[0]) 79 self.assertEqual(expected_frames, read_frames) 75 80 76 81 @params(*list_of_sounds) … … 159 164 if read < f.hop_size: 160 165 assert_equal(samples[:,read:], 0) 161 if 'brownnoise' in f.uri:162 self.assertEquals(np.count_nonzero(samples[:,:read]), read)163 166 break 164 167 #result_str = "read {:.2f}s ({:d} frames in {:d} channels and {:d} blocks at {:d}Hz) from {:s}"
Note: See TracChangeset
for help on using the changeset viewer.