Browse Source

[2136] corrected the improper test

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.
Naoki Kambe 13 years ago
parent
commit
4b19f8ee12
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/bin/stats/tests/b10-stats_test.py

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

@@ -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()