From 639744570818f9454c0c2550e68c0167aa71c2d9 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Mon, 15 Apr 2013 14:29:35 -0500 Subject: [PATCH] tests/api/test_analyzer.py: update --- tests/api/test_analyzer.py | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/tests/api/test_analyzer.py b/tests/api/test_analyzer.py index 2b8198d..ce3fa60 100644 --- a/tests/api/test_analyzer.py +++ b/tests/api/test_analyzer.py @@ -5,13 +5,12 @@ from sys import stdout import os.path import numpy - class TestAnalyzer: - graphers = timeside.core.processors(timeside.api.IGrapher) - decoders = timeside.core.processors(timeside.api.IDecoder) - encoders= timeside.core.processors(timeside.api.IEncoder) - analyzers = timeside.core.processors(timeside.api.IAnalyzer) + graphers = timeside.get_processors(timeside.api.IGrapher) + decoders = timeside.get_processors(timeside.api.IDecoder) + encoders= timeside.get_processors(timeside.api.IEncoder) + analyzers = timeside.get_processors(timeside.api.IAnalyzer) def __init__(self, path): self.source = os.path.join(os.path.dirname(__file__), path) @@ -29,14 +28,17 @@ class TestAnalyzer: self.pipe.run() def results(self): - analyzers = [] + results = [] for analyzer in self.analyzers_sub_pipe: - value = analyzer.result() - analyzers.append({'name':analyzer.name(), - 'id':analyzer.id(), - 'unit':analyzer.unit(), - 'value':str(value)}) - print analyzers + if hasattr(analyzer, 'results'): + results.append(analyzer.results()) + else: + value = analyzer.result() + results.append([{'name':analyzer.name(), + 'id':analyzer.id(), + 'unit':analyzer.unit(), + 'value':str(value)}]) + print results test = TestAnalyzer('../samples/guitar.wav') -- 2.39.5