shithub: aubio

Download patch

ref: 5e394ecc78197135efbec3d64ff9b4d3eec61358
parent: 913a7f1ce68a6a1cb25ed900aaf2fe2b4eeb9ce9
author: Paul Brossier <piem@piem.org>
date: Thu Jul 9 20:16:19 EDT 2015

tests/test_musicutils.py: improve test

--- a/python/tests/test_musicutils.py
+++ b/python/tests/test_musicutils.py
@@ -8,6 +8,22 @@
     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()