]> git.parisson.com Git - timeside.git/commitdiff
add simple test
authoryomguy <yomguy@parisson.com>
Wed, 19 Oct 2011 09:21:46 +0000 (09:21 +0000)
committeryomguy <yomguy@parisson.com>
Wed, 19 Oct 2011 09:21:46 +0000 (09:21 +0000)
timeside/tests/api/test_analyzer3.py [new file with mode: 0644]

diff --git a/timeside/tests/api/test_analyzer3.py b/timeside/tests/api/test_analyzer3.py
new file mode 100644 (file)
index 0000000..31b4604
--- /dev/null
@@ -0,0 +1,34 @@
+# -*- coding: utf-8 -*-
+
+import timeside
+import sys
+import os.path
+import numpy
+import time
+
+
+class TestAnalyzer:
+
+    analyzer = timeside.analyzer.MaxLevel()
+
+    def __init__(self, path):
+        self.source = os.path.join(os.path.dirname(__file__), path)
+        print "Processing %s" % self.source
+        self.decoder  = timeside.decoder.FileDecoder(self.source)
+        print 'format: ', self.decoder.format()
+        self.pipe = self.decoder
+        self.sub_pipe = self.analyzer
+
+    def process(self):
+        self.pipe = self.pipe | self.sub_pipe
+        self.pipe.run()
+
+    def results(self):
+        print {'name':self.analyzer.name(),
+                            'id':self.analyzer.id(),
+                            'unit':self.analyzer.unit(),
+                            'value':str(value)}
+
+test = TestAnalyzer(sys.argv[-1])
+test.process()
+test.results()