From 2d6b45e5e5b080d9b4f527734e7f3ae5fb1bf6f4 Mon Sep 17 00:00:00 2001 From: John Glover Date: Thu, 22 Mar 2012 22:46:30 +0000 Subject: [base] updating Cython Frame and PeakDetection classes --- tests/test_base.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/test_base.py b/tests/test_base.py index 4dac897..f9807ef 100644 --- a/tests/test_base.py +++ b/tests/test_base.py @@ -24,8 +24,26 @@ class TestFrame(object): f.synth_residual = a assert np.all(f.synth_residual == a) - def test_peak(self): + def test_peaks(self): p = base.Peak() p.amplitude = 0.5 p.frequency = 220.0 p.phase = 0.0 + + f = base.Frame() + assert f.num_peaks == 0 + assert f.max_peaks > 0 + f.add_peak(p) + + assert f.num_peaks == 1 + assert f.peak(0).amplitude == p.amplitude + assert f.peaks[0].amplitude == p.amplitude + + f.clear_peaks() + assert f.num_peaks == 0 + + +class TestPeakDetection(object): + def test_peak_detection(self): + pd = base.PeakDetection() + print pd -- cgit v1.2.3