Ignore:
Timestamp:
May 2, 2016, 4:43:42 PM (9 years ago)
Author:
Paul Brossier <piem@piem.org>
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:
55d5612
Parents:
3bf80b9
Message:

python/tests/test_cvec.py: check input sizes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/tests/test_cvec.py

    r3bf80b9 rcd53888  
    33from numpy.testing import TestCase
    44from numpy.testing import assert_equal, assert_almost_equal
    5 from aubio import cvec, float_type
     5from aubio import cvec, fvec, float_type
    66import numpy as np
    77
     
    7979        del new_spec
    8080
     81    def test_assign_norm_too_large(self):
     82        a = cvec(512)
     83        b = fvec(512//2+1 + 4)
     84        with self.assertRaises(ValueError):
     85            a.norm = b
     86
     87    def test_assign_norm_too_small(self):
     88        a = cvec(512)
     89        b = fvec(512//2+1 - 4)
     90        with self.assertRaises(ValueError):
     91            a.norm = b
     92
     93    def test_assign_phas_too_large(self):
     94        a = cvec(512)
     95        b = fvec(512//2+1 + 4)
     96        with self.assertRaises(ValueError):
     97            a.phas = b
     98
     99    def test_assign_phas_too_small(self):
     100        a = cvec(512)
     101        b = fvec(512//2+1 - 4)
     102        with self.assertRaises(ValueError):
     103            a.phas = b
     104
    81105if __name__ == '__main__':
    82106    from nose2 import main
Note: See TracChangeset for help on using the changeset viewer.