Browse Source

[2225_statistics] manipulate the counter via incrementer and getter methods

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

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

@@ -56,10 +56,13 @@ class TestBasicMethods(unittest.TestCase):
         self.counter.clear_counters()
         self.counter.clear_counters()
 
 
     def test_clear_counters(self):
     def test_clear_counters(self):
-        self.counter._statistics_data = {'counter': 1}
+        self.assertRaises(isc.cc.data.DataNotFoundError,
+                          self.counter.get, 'counter')
+        self.counter.inc('counter')
+        self.assertEqual(self.counter.get('counter'), 1)
         self.counter.clear_counters()
         self.counter.clear_counters()
-        self.assertEqual(self.counter._statistics_data,
-                         {})
+        self.assertRaises(isc.cc.data.DataNotFoundError,
+                          self.counter.get, 'counter')
 
 
     def test_enablediable(self):
     def test_enablediable(self):
         self.assertFalse(self.counter._disabled)
         self.assertFalse(self.counter._disabled)