feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change
on this file since 7359775 was
ca0a821,
checked in by Paul Brossier <piem@piem.org>, 15 years ago
|
tests/python/examples/aubionotes.py: do not assume the error is known
|
-
Property mode set to
100644
|
File size:
1.3 KB
|
Rev | Line | |
---|
[031b1f9] | 1 | from template import * |
---|
| 2 | |
---|
| 3 | class aubionotes_test_case(program_test_case): |
---|
| 4 | |
---|
| 5 | import os.path |
---|
| 6 | filename = os.path.join('..','..','sounds','woodblock.aiff') |
---|
[100f950] | 7 | progname = os.path.join('..','..','examples','aubionotes') |
---|
[031b1f9] | 8 | |
---|
| 9 | def test_aubionotes(self): |
---|
| 10 | """ test aubionotes with default parameters """ |
---|
| 11 | self.getOutput() |
---|
| 12 | # FIXME: useless check |
---|
[100f950] | 13 | self.assertEqual(len(self.output.split('\n')), 1) |
---|
| 14 | self.assertEqual(float(self.output.strip()), 0.017415) |
---|
[031b1f9] | 15 | |
---|
| 16 | def test_aubionotes_verbose(self): |
---|
| 17 | """ test aubionotes with -v parameter """ |
---|
| 18 | self.command += " -v " |
---|
| 19 | self.getOutput() |
---|
| 20 | # FIXME: loose checking: make sure at least 8 lines are printed |
---|
| 21 | assert len(self.output) >= 8 |
---|
| 22 | |
---|
| 23 | def test_aubionotes_devnull(self): |
---|
| 24 | """ test aubionotes on /dev/null """ |
---|
| 25 | self.filename = "/dev/null" |
---|
| 26 | # exit status should not be 0 |
---|
[100f950] | 27 | self.getOutput(expected_status = 256) |
---|
[031b1f9] | 28 | # and there should be an error message |
---|
| 29 | assert len(self.output) > 0 |
---|
| 30 | # that looks like this |
---|
[ca0a821] | 31 | #output_lines = self.output.split('\n') |
---|
| 32 | #for line in output_lines: |
---|
| 33 | # print line |
---|
[031b1f9] | 34 | |
---|
[100f950] | 35 | mode_names = ["yinfft", "yin", "fcomb", "mcomb", "schmitt"] |
---|
| 36 | for name in mode_names: |
---|
| 37 | exec("class aubionotes_test_case_" + name + "(aubionotes_test_case):\n\ |
---|
| 38 | options = \" -p " + name + " \"") |
---|
| 39 | |
---|
[031b1f9] | 40 | if __name__ == '__main__': unittest.main() |
---|
Note: See
TracBrowser
for help on using the repository browser.