Ignore:
Timestamp:
Nov 1, 2007, 4:40:15 PM (16 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:
1da7e08, d6f515d
Parents:
cea30b8
Message:

simplified examples template

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/python/examples/aubioonset.py

    rcea30b8 r100f950  
    1010    """ test aubioonset with default parameters """
    1111    self.getOutput()
    12     assert len(self.output) != 0, self.output
    1312    assert len(str(self.output)) != 0, "no output produced with command:\n" \
    1413      + self.command
     
    2524    self.getOutput()
    2625    # only one onset in woodblock.aiff
    27     assert len(self.output.split('\n')) == 1
    2826    assert len(str(self.output)) != 0, "no output produced with command:\n" \
    2927      + self.command
     28    assert len(self.output.split('\n')) == 1
    3029    # onset should be at 0.00000
    3130    assert float(self.output.strip()) == 0.
    3231
    33 class aubioonset_test_case_energy(aubioonset_test_case):
    34   def setUp(self, options = " -O energy "):
    35     aubioonset_test_case.setUp(self, options = options)
     32for name in ["energy", "specdiff", "hfc", "complex", "phase", "kl", "mkl"]:
     33  exec("class aubioonset_test_case_"+name+"(aubioonset_test_case):\n\
     34  options = \" -O "+name+" \"")
    3635
    37 class aubioonset_test_case_specdiff(aubioonset_test_case):
    38   def setUp(self, options = " -O specdiff "):
    39     aubioonset_test_case.setUp(self, options = options)
    40 
    41 class aubioonset_test_case_hfc(aubioonset_test_case):
    42   def setUp(self, options = " -O hfc "):
    43     aubioonset_test_case.setUp(self, options = options)
    44 
    45 class aubioonset_test_case_complex(aubioonset_test_case):
    46   def setUp(self, options = " -O complex "):
    47     aubioonset_test_case.setUp(self, options = options)
    48 
    49 class aubioonset_test_case_phase(aubioonset_test_case):
    50   def setUp(self, options = " -O phase"):
    51     aubioonset_test_case.setUp(self, options = options)
    52 
    53 class aubioonset_test_case_kl(aubioonset_test_case):
    54   def setUp(self, options = " -O kl "):
    55     aubioonset_test_case.setUp(self, options = options)
    56 
    57 class aubioonset_test_case_mkl(aubioonset_test_case):
    58   def setUp(self, options = " -O mkl "):
    59     aubioonset_test_case.setUp(self, options = options)
    60 
    61 if __name__ == '__main__':
    62 
    63   unittest.main()
     36if __name__ == '__main__': unittest.main()
Note: See TracChangeset for help on using the changeset viewer.