source: python/tests/test_aubio_cmd.py @ bdc980b

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5
Last change on this file since bdc980b was f4fcf02, checked in by Paul Brossier <piem@piem.org>, 7 years ago

python/tests/test_aubio_cmd.py: fix for python << 3

  • Property mode set to 100755
File size: 906 bytes
Line 
1#! /usr/bin/env python
2
3import aubio.cmd
4from nose2 import main
5from numpy.testing import TestCase
6
7class aubio_cmd(TestCase):
8
9    def setUp(self):
10        self.a_parser = aubio.cmd.aubio_parser()
11
12    def test_default_creation(self):
13        try:
14            assert self.a_parser.parse_args(['-V']).show_version
15        except SystemExit as e:
16            url = 'https://bugs.python.org/issue9253'
17            self.skipTest('subcommand became optional in py3, see %s' % url)
18
19class aubio_cmd_utils(TestCase):
20
21    def test_samples2seconds(self):
22        self.assertEqual(aubio.cmd.samples2seconds(3200, 32000), "0.100000\t")
23
24    def test_samples2milliseconds(self):
25        self.assertEqual(aubio.cmd.samples2milliseconds(3200, 32000), "100.000000\t")
26
27    def test_samples2samples(self):
28        self.assertEqual(aubio.cmd.samples2samples(3200, 32000), "3200\t")
29
30if __name__ == '__main__':
31    main()
Note: See TracBrowser for help on using the repository browser.