Changeset ca89d9f for python


Ignore:
Timestamp:
May 15, 2016, 9:59:38 PM (9 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
Children:
b1d37c0
Parents:
15a005d
Message:

python/tests/test_source.py: fix when python/tests/sounds exists

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/tests/test_source.py

    r15a005d rca89d9f  
    88
    99list_of_sounds = list_all_sounds('sounds')
    10 default_test_sound = None
    1110samplerates = [0, 44100, 8000, 32000]
    1211hop_sizes = [512, 1024, 64]
     
    2524    def setUp(self):
    2625        if not len(list_of_sounds): self.skipTest('add some sound files in \'python/tests/sounds\'')
    27         default_test_sound = list_of_sounds[0]
     26        self.default_test_sound = list_of_sounds[0]
    2827
    2928class aubio_source_test_case(aubio_source_test_case_base):
     
    115114            f = source('path_to/unexisting file.mp3')
    116115
    117 class aubio_source_test_wrong_params(aubio_source_test_case_base):
     116class aubio_source_test_wrong_params_with_file(aubio_source_test_case_base):
    118117
    119118    def test_wrong_samplerate(self):
    120119        with self.assertRaises(ValueError):
    121             f = source(default_test_sound, -1)
     120            f = source(self.default_test_sound, -1)
    122121
    123122    def test_wrong_hop_size(self):
    124123        with self.assertRaises(ValueError):
    125             f = source(default_test_sound, 0, -1)
     124            f = source(self.default_test_sound, 0, -1)
    126125
    127126    def test_wrong_channels(self):
    128127        with self.assertRaises(ValueError):
    129             f = source(default_test_sound, 0, 0, -1)
     128            f = source(self.default_test_sound, 0, 0, -1)
    130129
    131130    def test_wrong_seek(self):
    132         f = source(default_test_sound)
     131        f = source(self.default_test_sound)
    133132        with self.assertRaises(ValueError):
    134133            f.seek(-1)
    135134
    136135    def test_wrong_seek_too_large(self):
    137         f = source(default_test_sound)
     136        f = source(self.default_test_sound)
    138137        try:
    139138            with self.assertRaises(ValueError):
Note: See TracChangeset for help on using the changeset viewer.