]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2225_statistics] add checking validation of statistics data in case of no TEST_SPECF...
authorNaoki Kambe <kambe@jprs.co.jp>
Thu, 6 Dec 2012 03:38:51 +0000 (12:38 +0900)
committerNaoki Kambe <kambe@jprs.co.jp>
Thu, 6 Dec 2012 12:56:53 +0000 (21:56 +0900)
src/lib/python/isc/statistics/tests/counter_test.py

index f3608e8665abe2d2ae088db27f1b3c2d596a2d1a..22a312bc3b8f20ef73455c266c50969c8bcf5e00 100644 (file)
@@ -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