feature/cnnfeature/crepefeature/crepe_orgfix/ffmpeg5
Last change
on this file since 63fc1df was
fc144a5,
checked in by Paul Brossier <piem@piem.org>, 6 years ago
|
[tests] avoid some imports, add missing main
|
-
Property mode set to
100755
|
File size:
956 bytes
|
Rev | Line | |
---|
[799a940] | 1 | #! /usr/bin/env python |
---|
| 2 | |
---|
| 3 | from numpy.testing import TestCase |
---|
[fc144a5] | 4 | import aubio.cmd |
---|
[799a940] | 5 | |
---|
| 6 | class aubio_cmd(TestCase): |
---|
| 7 | |
---|
| 8 | def setUp(self): |
---|
| 9 | self.a_parser = aubio.cmd.aubio_parser() |
---|
| 10 | |
---|
| 11 | def test_default_creation(self): |
---|
[f4fcf02] | 12 | try: |
---|
| 13 | assert self.a_parser.parse_args(['-V']).show_version |
---|
[5eaed62] | 14 | except SystemExit: |
---|
[f4fcf02] | 15 | url = 'https://bugs.python.org/issue9253' |
---|
| 16 | self.skipTest('subcommand became optional in py3, see %s' % url) |
---|
[799a940] | 17 | |
---|
| 18 | class aubio_cmd_utils(TestCase): |
---|
| 19 | |
---|
| 20 | def test_samples2seconds(self): |
---|
[eb6f9d3] | 21 | self.assertEqual(aubio.cmd.samples2seconds(3200, 32000), |
---|
| 22 | "0.100000\t") |
---|
[799a940] | 23 | |
---|
| 24 | def test_samples2milliseconds(self): |
---|
[eb6f9d3] | 25 | self.assertEqual(aubio.cmd.samples2milliseconds(3200, 32000), |
---|
| 26 | "100.000000\t") |
---|
[799a940] | 27 | |
---|
| 28 | def test_samples2samples(self): |
---|
[eb6f9d3] | 29 | self.assertEqual(aubio.cmd.samples2samples(3200, 32000), |
---|
| 30 | "3200\t") |
---|
[799a940] | 31 | |
---|
| 32 | if __name__ == '__main__': |
---|
[fc144a5] | 33 | from unittest import main |
---|
[799a940] | 34 | main() |
---|
Note: See
TracBrowser
for help on using the repository browser.