Ignore:
Timestamp:
Nov 1, 2007, 4:40:15 PM (13 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master, pitchshift, sampler, timestretch, yinfft+
Children:
1da7e08, d6f515d
Parents:
cea30b8
Message:

simplified examples template

File:
1 edited

Legend:

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

    rcea30b8 r100f950  
    55  import os.path
    66  filename = os.path.join('..','..','sounds','woodblock.aiff')
    7   progname = os.path.join('..','..','examples','aubioonset')
     7  progname = os.path.join('..','..','examples','aubionotes')
    88
    99  def test_aubionotes(self):
     
    1111    self.getOutput()
    1212    # FIXME: useless check
    13     assert len(self.output) >= 0
     13    self.assertEqual(len(self.output.split('\n')), 1)
     14    self.assertEqual(float(self.output.strip()), 0.017415)
    1415
    1516  def test_aubionotes_verbose(self):
     
    2425    self.filename = "/dev/null"
    2526    # exit status should not be 0
    26     self.getOutput(expected_status = -1)
    27     assert self.status != 0
     27    self.getOutput(expected_status = 256)
    2828    # and there should be an error message
    2929    assert len(self.output) > 0
     
    3434    assert output_lines[2] == "Could not open input file /dev/null."
    3535
     36mode_names = ["yinfft", "yin", "fcomb", "mcomb", "schmitt"]
     37for name in mode_names:
     38  exec("class aubionotes_test_case_" + name + "(aubionotes_test_case):\n\
     39    options = \" -p " + name + " \"")
     40
    3641if __name__ == '__main__': unittest.main()
Note: See TracChangeset for help on using the changeset viewer.