]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2136] corrected the improper test
authorNaoki Kambe <kambe@jprs.co.jp>
Wed, 8 Aug 2012 12:29:24 +0000 (21:29 +0900)
committerNaoki Kambe <kambe@jprs.co.jp>
Thu, 9 Aug 2012 04:41:12 +0000 (13:41 +0900)
Not self.stats.mccs.specification but self.stats.modules['Stats'] should be set
the invalid spec_module into. And it should check whether StatsError is raised
by setting the owner to the self module name in the argument of command_show.

src/bin/stats/tests/b10-stats_test.py

index a6a51d535154528c40d27cc67a13d8b10d3361a8..5a7b6b1d0d15a46848bcb1488843aa30a166cafa 100644 (file)
@@ -587,11 +587,11 @@ class TestStats(unittest.TestCase):
                 0, {'Stats': {'timestamp':self.const_timestamp}}))
         stats.get_datetime = orig_get_datetime
         stats.get_timestamp = orig_get_timestamp
-        self.stats.mccs.specification = isc.config.module_spec.ModuleSpec(
+        self.stats.modules[self.stats.module_name] = isc.config.module_spec.ModuleSpec(
             { "module_name": self.stats.module_name,
               "statistics": [] } )
         self.assertRaises(
-            stats.StatsError, self.stats.command_show, owner='Foo', name='bar')
+            stats.StatsError, self.stats.command_show, owner=self.stats.module_name, name='bar')
 
     def test_command_showchema(self):
         self.stats = stats.Stats()