Changeset 9f8cd9f for python


Ignore:
Timestamp:
May 2, 2016, 12:46:30 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:
37ca459
Parents:
867d66e
Message:

python/tests/test_cvec.py: simplify, use nose2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/tests/test_cvec.py

    r867d66e r9f8cd9f  
    11#! /usr/bin/env python
    22
    3 from numpy.testing import TestCase, run_module_suite
     3from numpy.testing import TestCase
    44from numpy.testing import assert_equal, assert_almost_equal
    5 from aubio import cvec
    6 from numpy import array, shape, pi
     5from aubio import cvec, float_type
     6import numpy as np
    77
    88class aubio_cvec_test_case(TestCase):
     
    1010    def test_vector_created_with_zeroes(self):
    1111        a = cvec(10)
    12         shape(a.norm)
    13         shape(a.phas)
     12        assert_equal(a.norm.shape[0], 10 / 2 + 1)
     13        assert_equal(a.phas.shape[0], 10 / 2 + 1)
    1414        a.norm[0]
    1515        assert_equal(a.norm, 0.)
     
    4242    def test_assign_cvec_phas_slice(self):
    4343        spec = cvec(1024)
    44         spec.phas[39:-1] = -pi
     44        spec.phas[39:-1] = -np.pi
    4545        assert_equal(spec.phas[0:39], 0)
    46         assert_equal(spec.phas[39:-1], -pi)
     46        assert_equal(spec.phas[39:-1], -np.pi)
    4747        assert_equal(spec.norm, 0)
    4848
    4949if __name__ == '__main__':
    50     from unittest import main
     50    from nose2 import main
    5151    main()
Note: See TracChangeset for help on using the changeset viewer.