source: tests/python/examples/aubionotes.py @ 031b1f9

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change on this file since 031b1f9 was 031b1f9, checked in by Paul Brossier <piem@piem.org>, 16 years ago

added examples tests

  • Property mode set to 100644
File size: 1.2 KB
Line 
1from template import *
2
3class aubionotes_test_case(program_test_case):
4
5  import os.path
6  filename = os.path.join('..','..','sounds','woodblock.aiff')
7  progname = os.path.join('..','..','examples','aubioonset')
8
9  def test_aubionotes(self):
10    """ test aubionotes with default parameters """
11    self.getOutput()
12    # FIXME: useless check
13    assert len(self.output) >= 0
14
15  def test_aubionotes_verbose(self):
16    """ test aubionotes with -v parameter """
17    self.command += " -v "
18    self.getOutput()
19    # FIXME: loose checking: make sure at least 8 lines are printed
20    assert len(self.output) >= 8
21
22  def test_aubionotes_devnull(self):
23    """ test aubionotes on /dev/null """
24    self.filename = "/dev/null"
25    # exit status should not be 0
26    self.getOutput(expected_status = -1)
27    assert self.status != 0
28    # and there should be an error message
29    assert len(self.output) > 0
30    # that looks like this
31    output_lines = self.output.split('\n')
32    assert output_lines[0] == "Unable to open input file /dev/null."
33    #assert output_lines[1] == "Supported file format but file is malformed."
34    assert output_lines[2] == "Could not open input file /dev/null."
35
36if __name__ == '__main__': unittest.main()
Note: See TracBrowser for help on using the repository browser.