shithub: aubio

Download patch

ref: 493e6f7a0834dbb57621a1d06596b8a94b5ed3ad
parent: 549825aa3607dc3586003b061cd53169087641c2
author: Paul Brossier <piem@piem.org>
date: Sat Jan 9 10:21:54 EST 2010

test_fvec.py: add test_alpha_norm_of_none and test_vector_create_with_list

--- a/interfaces/python/test_fvec.py
+++ b/interfaces/python/test_fvec.py
@@ -13,6 +13,10 @@
         #del a
         assert_equal(array(a), 0.)
 
+    def test_vector_create_with_list(self):
+        a = fvec([0,1,2,3])
+        assert_equal (range(4), a)
+
     def test_vector_assign_element(self):
         a = fvec()
         a[0] = 1
@@ -52,6 +56,9 @@
         a = array([0, 1], dtype='float32')
         from math import sqrt
         assert_almost_equal (alpha_norm(a, 2), sqrt(2)/2.)
+
+    def test_alpha_norm_of_none(self):
+        self.assertRaises (ValueError, alpha_norm, None, 1)
 
     def test_alpha_norm_of_array_of_float32(self):
         # check scalar fails