Changeset ece990f


Ignore:
Timestamp:
May 11, 2016, 2:53:11 AM (4 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master, pitchshift, sampler, timestretch, yinfft+
Children:
34d0c25
Parents:
2871e2b
Message:

python/tests/test_filter.py: fix indent

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/tests/test_filter.py

    r2871e2b rece990f  
    88class aubio_filter_test_case(TestCase):
    99
    10   def test_members(self):
    11     f = digital_filter()
    12     assert_equal (f.order, 7)
    13     f = digital_filter(5)
    14     assert_equal (f.order, 5)
    15     f(fvec())
    16  
    17   def test_cweighting_error(self):
    18     f = digital_filter (2)
    19     self.assertRaises ( ValueError, f.set_c_weighting, 44100 )
    20     f = digital_filter (8)
    21     self.assertRaises ( ValueError, f.set_c_weighting, 44100 )
    22     f = digital_filter (5)
    23     self.assertRaises ( ValueError, f.set_c_weighting, 4000 )
    24     f = digital_filter (5)
    25     self.assertRaises ( ValueError, f.set_c_weighting, 193000 )
    26     f = digital_filter (7)
    27     self.assertRaises ( ValueError, f.set_a_weighting, 193000 )
    28     f = digital_filter (5)
    29     self.assertRaises ( ValueError, f.set_a_weighting, 192000 )
     10    def test_members(self):
     11        f = digital_filter()
     12        assert_equal (f.order, 7)
     13        f = digital_filter(5)
     14        assert_equal (f.order, 5)
     15        f(fvec())
    3016
    31   def test_c_weighting(self):
    32     expected = array_from_text_file('c_weighting_test_simple.expected')
    33     f = digital_filter(5)
    34     f.set_c_weighting(44100)
    35     v = fvec(32)
    36     v[12] = .5
    37     u = f(v)
    38     assert_almost_equal (expected[1], u)
     17    def test_cweighting_error(self):
     18        f = digital_filter (2)
     19        self.assertRaises ( ValueError, f.set_c_weighting, 44100 )
     20        f = digital_filter (8)
     21        self.assertRaises ( ValueError, f.set_c_weighting, 44100 )
     22        f = digital_filter (5)
     23        self.assertRaises ( ValueError, f.set_c_weighting, 4000 )
     24        f = digital_filter (5)
     25        self.assertRaises ( ValueError, f.set_c_weighting, 193000 )
     26        f = digital_filter (7)
     27        self.assertRaises ( ValueError, f.set_a_weighting, 193000 )
     28        f = digital_filter (5)
     29        self.assertRaises ( ValueError, f.set_a_weighting, 192000 )
    3930
    40   def test_c_weighting_8000(self):
    41     expected = array_from_text_file('c_weighting_test_simple_8000.expected')
    42     f = digital_filter(5)
    43     f.set_c_weighting(8000)
    44     v = fvec(32)
    45     v[12] = .5
    46     u = f(v)
    47     assert_almost_equal (expected[1], u)
     31    def test_c_weighting(self):
     32        expected = array_from_text_file('c_weighting_test_simple.expected')
     33        f = digital_filter(5)
     34        f.set_c_weighting(44100)
     35        v = fvec(32)
     36        v[12] = .5
     37        u = f(v)
     38        assert_almost_equal (expected[1], u)
    4839
    49   def test_a_weighting(self):
    50     expected = array_from_text_file('a_weighting_test_simple.expected')
    51     f = digital_filter(7)
    52     f.set_a_weighting(44100)
    53     v = fvec(32)
    54     v[12] = .5
    55     u = f(v)
    56     assert_almost_equal (expected[1], u)
     40    def test_c_weighting_8000(self):
     41        expected = array_from_text_file('c_weighting_test_simple_8000.expected')
     42        f = digital_filter(5)
     43        f.set_c_weighting(8000)
     44        v = fvec(32)
     45        v[12] = .5
     46        u = f(v)
     47        assert_almost_equal (expected[1], u)
    5748
    58   def test_a_weighting_parted(self):
    59     expected = array_from_text_file('a_weighting_test_simple.expected')
    60     f = digital_filter(7)
    61     f.set_a_weighting(44100)
    62     v = fvec(16)
    63     v[12] = .5
    64     u = f(v)
    65     assert_almost_equal (expected[1][:16], u)
    66     # one more time
    67     v = fvec(16)
    68     u = f(v)
    69     assert_almost_equal (expected[1][16:], u)
     49    def test_a_weighting(self):
     50        expected = array_from_text_file('a_weighting_test_simple.expected')
     51        f = digital_filter(7)
     52        f.set_a_weighting(44100)
     53        v = fvec(32)
     54        v[12] = .5
     55        u = f(v)
     56        assert_almost_equal (expected[1], u)
    7057
    71   def test_set_biquad(self):
    72     f = digital_filter(3)
    73     f.set_biquad(0., 0., 0, 0., 0.)
     58    def test_a_weighting_parted(self):
     59        expected = array_from_text_file('a_weighting_test_simple.expected')
     60        f = digital_filter(7)
     61        f.set_a_weighting(44100)
     62        v = fvec(16)
     63        v[12] = .5
     64        u = f(v)
     65        assert_almost_equal (expected[1][:16], u)
     66        # one more time
     67        v = fvec(16)
     68        u = f(v)
     69        assert_almost_equal (expected[1][16:], u)
    7470
    75   def test_set_biquad_wrong_order(self):
    76     f = digital_filter(4)
    77     with self.assertRaises(ValueError):
     71    def test_set_biquad(self):
     72        f = digital_filter(3)
    7873        f.set_biquad(0., 0., 0, 0., 0.)
     74
     75    def test_set_biquad_wrong_order(self):
     76        f = digital_filter(4)
     77        with self.assertRaises(ValueError):
     78            f.set_biquad(0., 0., 0, 0., 0.)
    7979
    8080class aubio_filter_wrong_params(TestCase):
Note: See TracChangeset for help on using the changeset viewer.