Changeset f1771f9 for tests/python


Ignore:
Timestamp:
Dec 1, 2007, 3:51:27 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:
8987df1
Parents:
c71b717
Message:

aubioonset.py tests: add specflux, use assertEqual

File:
1 edited

Legend:

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

    rc71b717 rf1771f9  
    11from template import *
    22
    3 class aubioonset_test_case(program_test_case):
     3class aubioonset_unit(program_test_case):
    44 
    55  import os.path
     
    2424    self.getOutput()
    2525    # only one onset in woodblock.aiff
    26     assert len(str(self.output)) != 0, "no output produced with command:\n" \
    27       + self.command
    28     assert len(self.output.split('\n')) == 1
     26    self.assertNotEqual(0, len(str(self.output)), \
     27      "no output produced with command:\n" + self.command)
     28    self.assertEqual(1, len(self.output.split('\n')) )
    2929    # onset should be at 0.00000
    30     assert float(self.output.strip()) == 0.
     30    self.assertEqual(0, float(self.output.strip()))
    3131
    32 for name in ["energy", "specdiff", "hfc", "complex", "phase", "kl", "mkl"]:
    33   exec("class aubioonset_test_case_"+name+"(aubioonset_test_case):\n\
     32list_of_onset_modes = ["energy", "specdiff", "hfc", "complex", "phase", \
     33                      "kl", "mkl", "specflux"]
     34
     35for name in list_of_onset_modes:
     36  exec("class aubioonset_"+name+"_unit(aubioonset_unit):\n\
    3437  options = \" -O "+name+" \"")
    3538
Note: See TracChangeset for help on using the changeset viewer.