Merge branch 'master' into coveralls
[aubio.git] / python / tests / test_aubio_cmd.py
1 #! /usr/bin/env python
2
3 import aubio.cmd
4 from nose2 import main
5 from numpy.testing import TestCase
6
7 class 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
15 class 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
26 if __name__ == '__main__':
27     main()