]> git.parisson.com Git - timeside.git/commitdiff
timeside/analyzer/core.py: add __eq__ to AnalyzerResultContainer
authorPaul Brossier <piem@piem.org>
Tue, 16 Apr 2013 00:04:14 +0000 (19:04 -0500)
committerPaul Brossier <piem@piem.org>
Tue, 16 Apr 2013 00:04:14 +0000 (19:04 -0500)
timeside/analyzer/core.py

index 99ac45a4acbc3b2f8769388efb35b0de198ec83c..4e1a29c235df2970eed40a5c4477915d0ecbb9e3 100644 (file)
@@ -91,6 +91,13 @@ class AnalyzerResultContainer(object):
     def __repr__(self):
         return self.to_json()
 
+    def __eq__(self, that):
+        if hasattr(that, 'results'):
+            that = that.results
+        for a, b in zip(self.results, that):
+            if a != b: return False
+        return True
+
     def add_result(self, analyzer_result):
         if type(analyzer_result) == list:
             for a in analyzer_result: