Changeset 973206a
- Timestamp:
- Mar 8, 2013, 8:38:17 PM (12 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
- Children:
- 2cedc83
- Parents:
- 0a42239
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/tests/test_fvec.py
r0a42239 r973206a 6 6 from numpy import array, shape 7 7 8 default_size = 512 9 8 10 class aubio_fvec_test_case(TestCase): 9 11 10 12 def test_vector_created_with_zeroes(self): 11 13 a = fvec(10) 12 a 13 shape(a) 14 a[0] 15 #del a 16 assert_equal(array(a), 0.) 14 assert a.dtype == 'float32' 15 assert a.shape == (10,) 16 assert_equal (a, 0) 17 17 18 18 def test_vector_create_with_list(self): 19 19 a = fvec([0,1,2,3]) 20 assert a.dtype == 'float32' 21 assert a.shape == (4,) 20 22 assert_equal (range(4), a) 21 23 22 24 def test_vector_assign_element(self): 23 a = fvec( )25 a = fvec(default_size) 24 26 a[0] = 1 25 27 assert_equal(a[0], 1) 26 28 27 29 def test_vector_assign_element_end(self): 28 a = fvec( )30 a = fvec(default_size) 29 31 a[-1] = 1 30 32 assert_equal(a[-1], 1)
Note: See TracChangeset
for help on using the changeset viewer.