3 new revisions:

Revision: 213860eda820
Author:   Pekka Klärck
Date:     Mon Nov 14 05:16:01 2011
Log: experimenting with relative improrts (also imported SuiteVisitor from ...
http://code.google.com/p/robotframework/source/detail?r=213860eda820

Revision: be7f2d857ab8
Author:   Pekka Klärck
Date:     Mon Nov 14 07:23:58 2011
Log:      cleanup and todos
http://code.google.com/p/robotframework/source/detail?r=be7f2d857ab8

Revision: 63e07f35c7e9
Author:   Pekka Klärck
Date:     Mon Nov 14 08:22:28 2011
Log:      rm methods apparently not used anywhere. also added one more todo.
http://code.google.com/p/robotframework/source/detail?r=63e07f35c7e9

==============================================================================
Revision: 213860eda820
Author:   Pekka Klärck
Date:     Mon Nov 14 05:16:01 2011
Log: experimenting with relative improrts (also imported SuiteVisitor from correct plage)
http://code.google.com/p/robotframework/source/detail?r=213860eda820

Modified:
 /src/robot/model/statistics.py

=======================================
--- /src/robot/model/statistics.py      Mon Nov 14 04:41:32 2011
+++ /src/robot/model/statistics.py      Mon Nov 14 05:16:01 2011
@@ -12,10 +12,10 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.

-from robot.model.tagstatistics import TagStatistics
-from robot.model.suitestatistics import SuiteStatistics
-from robot.model.totalstatistics import TotalStatistics
-from robot.result.visitor import SuiteVisitor
+from .tagstatistics import TagStatistics
+from .suitestatistics import SuiteStatistics
+from .totalstatistics import TotalStatistics
+from .visitor import SuiteVisitor


 class Statistics(object):

==============================================================================
Revision: be7f2d857ab8
Author:   Pekka Klärck
Date:     Mon Nov 14 07:23:58 2011
Log:      cleanup and todos
http://code.google.com/p/robotframework/source/detail?r=be7f2d857ab8

Modified:
 /src/robot/model/stats.py

=======================================
--- /src/robot/model/stats.py   Mon Nov 14 04:41:32 2011
+++ /src/robot/model/stats.py   Mon Nov 14 07:23:58 2011
@@ -22,23 +22,24 @@

     @property
     def _default_attrs(self):
-        return {'pass': str(self.passed),
-                'fail': str(self.failed)}
+        return {'pass': str(self.passed), 'fail': str(self.failed)}

     @property
     def total(self):
         return self.passed + self.failed

-    def add_stat(self, other):
-        self.passed += other.passed
-        self.failed += other.failed
-
     def add_test(self, test):
         if test.status == 'PASS':
             self.passed += 1
         else:
             self.failed += 1

+    # TODO: Are all methods below actually used somewhere??
+
+    def add_stat(self, other):
+        self.passed += other.passed
+        self.failed += other.failed
+
     def fail_all(self):
         self.failed += self.passed
         self.passed = 0
@@ -86,7 +87,7 @@
                  non_critical=False, combined=''):
         Stat.__init__(self, name)
         self.doc = doc
-        self.links = links
+ self.links = links # TODO: Are both self.links and self._link_str needed?
         self.critical = critical
         self.non_critical = non_critical
         self.combined = combined
@@ -94,7 +95,7 @@

     @property
     def attrs(self):
- return dict(self._default_attrs, info=self._info, links=self._links, + return dict(self._default_attrs, info=self._info, links=self._link_str,
                     doc=self.doc, combined=self.combined)

     @property
@@ -108,7 +109,7 @@
         return ''

     @property
-    def _links(self):
+    def _link_str(self):
return ':::'.join(':'.join([title, url]) for url, title in self.links)

     def add_test(self, test):
@@ -116,13 +117,10 @@
         self.tests.append(test)

     def __cmp__(self, other):
-        if self.critical != other.critical:
-            return cmp(other.critical, self.critical)
-        if self.non_critical != other.non_critical:
-            return cmp(other.non_critical, self.non_critical)
-        if bool(self.combined) != bool(other.combined):
-            return cmp(bool(other.combined), bool(self.combined))
-        return cmp(self.name, other.name)
+        return cmp(other.critical, self.critical) \
+            or cmp(other.non_critical, self.non_critical) \
+            or cmp(bool(other.combined), bool(self.combined)) \
+            or cmp(self.name, other.name)


 class TotalStat(Stat):

==============================================================================
Revision: 63e07f35c7e9
Author:   Pekka Klärck
Date:     Mon Nov 14 08:22:28 2011
Log:      rm methods apparently not used anywhere. also added one more todo.
http://code.google.com/p/robotframework/source/detail?r=63e07f35c7e9

Modified:
 /src/robot/model/stats.py

=======================================
--- /src/robot/model/stats.py   Mon Nov 14 07:23:58 2011
+++ /src/robot/model/stats.py   Mon Nov 14 08:22:28 2011
@@ -40,23 +40,6 @@
         self.passed += other.passed
         self.failed += other.failed

-    def fail_all(self):
-        self.failed += self.passed
-        self.passed = 0
-
-    def add_suite(self, suite):
-        for test in suite.tests:
-            if self._is_included(test):
-                self.add_test(test)
-        for suite in suite.suites:
-            self.add_stat(self._subsuite_stats(suite))
-
-    def _is_included(self, test):
-        return True
-
-    def _subsuite_stats(self, suite):
-        return suite.all_stats
-
     def __cmp__(self, other):
         return cmp(self.name, other.name)

@@ -86,6 +69,7 @@
     def __init__(self, name, doc='', links=[], critical=False,
                  non_critical=False, combined=''):
         Stat.__init__(self, name)
+ # TODO: Do we need all these attrs or could they me only in self.attrs?
         self.doc = doc
self.links = links # TODO: Are both self.links and self._link_str needed?
         self.critical = critical

Reply via email to