source: python/tests/test_aubio_cmd.py @ 799a940

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

python/tests/test_aubio_*.py: add basic tests

  • Property mode set to 100755
File size: 726 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        assert self.a_parser.parse_args(['-V']).show_version
14
15class aubio_cmd_utils(TestCase):
16
17    def test_samples2seconds(self):
18        self.assertEqual(aubio.cmd.samples2seconds(3200, 32000), "0.100000\t")
19
20    def test_samples2milliseconds(self):
21        self.assertEqual(aubio.cmd.samples2milliseconds(3200, 32000), "100.000000\t")
22
23    def test_samples2samples(self):
24        self.assertEqual(aubio.cmd.samples2samples(3200, 32000), "3200\t")
25
26if __name__ == '__main__':
27    main()
Note: See TracBrowser for help on using the repository browser.