From: Naoki Kambe Date: Thu, 6 Dec 2012 03:38:51 +0000 (+0900) Subject: [2225_statistics] add checking validation of statistics data in case of no TEST_SPECF... X-Git-Tag: bind10-1.1.0beta1-release~72^2~40^2~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e78b80b2a929ab815dee2d4ff6c7e29315a5f2f7;p=thirdparty%2Fkea.git [2225_statistics] add checking validation of statistics data in case of no TEST_SPECFILE_LOCATION --- diff --git a/src/lib/python/isc/statistics/tests/counter_test.py b/src/lib/python/isc/statistics/tests/counter_test.py index f3608e8665..22a312bc3b 100644 --- a/src/lib/python/isc/statistics/tests/counter_test.py +++ b/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