From 493e6f7a0834dbb57621a1d06596b8a94b5ed3ad Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Sat, 9 Jan 2010 15:21:54 +0100 Subject: [PATCH] test_fvec.py: add test_alpha_norm_of_none and test_vector_create_with_list --- interfaces/python/test_fvec.py | 7 +++++++ 1 file changed, 7 insertions(+) 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') -- 2.26.2