From: Paul Brossier Date: Sat, 9 Jan 2010 14:21:54 +0000 (+0100) Subject: test_fvec.py: add test_alpha_norm_of_none and test_vector_create_with_list X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=493e6f7a0834dbb57621a1d06596b8a94b5ed3ad;p=aubio.git test_fvec.py: add test_alpha_norm_of_none and test_vector_create_with_list --- diff --git a/interfaces/python/test_fvec.py b/interfaces/python/test_fvec.py index 3077ffe6..b374c4e1 100644 --- a/interfaces/python/test_fvec.py +++ b/interfaces/python/test_fvec.py @@ -13,6 +13,10 @@ class aubio_fvec_test_case(TestCase): #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 @@ -53,6 +57,9 @@ class aubio_fvec_test_case(TestCase): 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 a = array(1, dtype = 'float32')