tests/test_musicutils.py: improve test
authorPaul Brossier <piem@piem.org>
Thu, 9 Jul 2015 22:16:19 +0000 (00:16 +0200)
committerPaul Brossier <piem@piem.org>
Thu, 9 Jul 2015 22:16:19 +0000 (00:16 +0200)
python/tests/test_musicutils.py

index acbe08a..15282ae 100755 (executable)
@@ -8,6 +8,22 @@ class aubio_window(TestCase):
     def test_accept_name_and_size(self):
         window("default", 1024)
 
+    def test_fail_name_not_string(self):
+        try:
+            window(10, 1024)
+        except ValueError, e:
+            pass
+        else:
+            self.fail('non-string window type does not raise a ValueError')
+
+    def test_fail_size_not_int(self):
+        try:
+            window("default", "default")
+        except ValueError, e:
+            pass
+        else:
+            self.fail('non-integer window length does not raise a ValueError')
+
 if __name__ == '__main__':
     from unittest import main
     main()