[Pkg-mozext-commits] [requestpolicy] 92/257: [tst][ref] RPTestCase: change function order

David Prévot taffit at moszumanska.debian.org
Thu Jan 28 03:20:00 UTC 2016


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository requestpolicy.

commit 590f588b0cd19cd6bcba316fb136d236a3a6ee67
Author: Martin Kimmerle <dev at 256k.de>
Date:   Fri Oct 16 15:04:24 2015 +0200

    [tst][ref] RPTestCase: change function order
---
 tests/marionette/rp_ui_harness/testcases.py | 50 ++++++++++++++---------------
 1 file changed, 25 insertions(+), 25 deletions(-)

diff --git a/tests/marionette/rp_ui_harness/testcases.py b/tests/marionette/rp_ui_harness/testcases.py
index db07567..f2cfbb6 100644
--- a/tests/marionette/rp_ui_harness/testcases.py
+++ b/tests/marionette/rp_ui_harness/testcases.py
@@ -20,22 +20,29 @@ class RequestPolicyTestCase(RequestPolicyPuppeteer, FirefoxTestCase):
     def __init__(self, *args, **kwargs):
         FirefoxTestCase.__init__(self, *args, **kwargs)
 
+    #################################
+    # Public Properties and Methods #
+    #################################
 
-    def _check_error_counts(self):
-        self.assertEqual(self.logging_error_detect.get_error_count(), 0,
-                         msg="The Logging error count is zero.")
-        self.assertEqual(self.console_error_detect.get_error_count(), 0,
-                         msg="The Console error count is zero.")
+    def setUp(self, *args, **kwargs):
+        FirefoxTestCase.setUp(self, *args, **kwargs)
 
-    def _reset_error_counts(self):
-        self.logging_error_detect.reset_error_count()
-        self.console_error_detect.reset_error_count()
+        marionette_getter = lambda: self.marionette
+        self.logging_error_detect = LoggingErrorDetection(marionette_getter)
+        self.console_error_detect = ConsoleErrorDetection(marionette_getter)
 
-    def _check_and_reset_error_counts(self):
+        self._check_and_reset_error_counts()
+
+    def tearDown(self, *args, **kwargs):
         try:
-            self._check_error_counts()
+            self._check_rules_and_remove_all()
+            self._check_and_reset_error_counts()
         finally:
-            self._reset_error_counts()
+            FirefoxTestCase.tearDown(self, *args, **kwargs)
+
+    ##################################
+    # Private Properties and Methods #
+    ##################################
 
     def _check_rules_and_remove_all(self):
         try:
@@ -46,19 +53,12 @@ class RequestPolicyTestCase(RequestPolicyPuppeteer, FirefoxTestCase):
         finally:
             self.rules.remove_all()
 
-
-    def setUp(self, *args, **kwargs):
-        FirefoxTestCase.setUp(self, *args, **kwargs)
-
-        marionette_getter = lambda: self.marionette
-        self.logging_error_detect = LoggingErrorDetection(marionette_getter)
-        self.console_error_detect = ConsoleErrorDetection(marionette_getter)
-
-        self._check_and_reset_error_counts()
-
-    def tearDown(self, *args, **kwargs):
+    def _check_and_reset_error_counts(self):
         try:
-            self._check_rules_and_remove_all()
-            self._check_and_reset_error_counts()
+            self.assertEqual(self.logging_error_detect.get_error_count(), 0,
+                             "The Logging error count is zero.")
+            self.assertEqual(self.console_error_detect.get_error_count(), 0,
+                             "The Console error count is zero.")
         finally:
-            FirefoxTestCase.tearDown(self, *args, **kwargs)
+            self.logging_error_detect.reset_error_count()
+            self.console_error_detect.reset_error_count()

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/requestpolicy.git



More information about the Pkg-mozext-commits mailing list