Browse Source

[2225_statistics] change the order of the parent classes and add setUp() and tearDown() into the child classes

Naoki Kambe 12 years ago
parent
commit
0a10b2ed25
1 changed files with 15 additions and 3 deletions
  1. 15 3
      src/lib/python/isc/statistics/tests/counter_test.py

+ 15 - 3
src/lib/python/isc/statistics/tests/counter_test.py

@@ -322,14 +322,26 @@ class BaseTestCounter():
                 'socket/%s/tcp/%s' % counter_name, 2)
                 'socket/%s/tcp/%s' % counter_name, 2)
         self.check_dump_statistics()
         self.check_dump_statistics()
 
 
-class TestCounter1(BaseTestCounter, unittest.TestCase):
+class TestCounter1(unittest.TestCase, BaseTestCounter):
     TEST_SPECFILE_LOCATION = TESTDATA_SRCDIR + os.sep + 'test_spec1.spec'
     TEST_SPECFILE_LOCATION = TESTDATA_SRCDIR + os.sep + 'test_spec1.spec'
+    def setUp(self):
+        BaseTestCounter.setUp(self)
+    def tearDown(self):
+        BaseTestCounter.tearDown(self)
 
 
-class TestCounter2(BaseTestCounter, unittest.TestCase):
+class TestCounter2(unittest.TestCase, BaseTestCounter):
     TEST_SPECFILE_LOCATION = TESTDATA_SRCDIR + os.sep + 'test_spec2.spec'
     TEST_SPECFILE_LOCATION = TESTDATA_SRCDIR + os.sep + 'test_spec2.spec'
+    def setUp(self):
+        BaseTestCounter.setUp(self)
+    def tearDown(self):
+        BaseTestCounter.tearDown(self)
 
 
-class TestCounter3(BaseTestCounter, unittest.TestCase):
+class TestCounter3(unittest.TestCase, BaseTestCounter):
     TEST_SPECFILE_LOCATION = TESTDATA_SRCDIR + os.sep + 'test_spec3.spec'
     TEST_SPECFILE_LOCATION = TESTDATA_SRCDIR + os.sep + 'test_spec3.spec'
+    def setUp(self):
+        BaseTestCounter.setUp(self)
+    def tearDown(self):
+        BaseTestCounter.tearDown(self)
 
 
 if __name__== "__main__":
 if __name__== "__main__":
     unittest.main()
     unittest.main()