Browse Source

[2225_statistics] add checking validation of statistics data in case of no TEST_SPECFILE_LOCATION

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

+ 10 - 2
src/lib/python/isc/statistics/tests/counter_test.py

@@ -167,8 +167,16 @@ class BaseTestCounter():
         # Idempotency check
         self.assertEqual(self.counter.dump_statistics(),
                          self._statistics_data)
-        self.assertTrue(self._module_spec.validate_statistics(
-                False, self._statistics_data))
+        if self.TEST_SPECFILE_LOCATION:
+            self.assertTrue(isc.config.module_spec_from_file(
+                    self.TEST_SPECFILE_LOCATION).validate_statistics(
+                    False, self._statistics_data))
+        else:
+            self.assertTrue(isc.config.ModuleSpec(
+                    {'module_name': 'Foo',
+                     'statistics': self.counter._statistics._spec}
+                    ).validate_statistics(
+                    False, self._statistics_data))
 
     def test_perzone_counters(self):
         # for per-zone counters