Browse Source

[3028] Check the shutdown is actually called

Michal 'vorner' Vaner 11 years ago
parent
commit
a8bb19e316
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/bin/cmdctl/tests/cmdctl_test.py

+ 3 - 1
src/bin/cmdctl/tests/cmdctl_test.py

@@ -468,14 +468,16 @@ class TestCommandControl(unittest.TestCase):
             def send_stopping():
             def send_stopping():
                 pass
                 pass
         self.cmdctl._module_cc = ModuleCC
         self.cmdctl._module_cc = ModuleCC
+        called = []
         class Server:
         class Server:
             def shutdown():
             def shutdown():
-                pass
+                called.append('shutdown')
         self.cmdctl._httpserver = Server
         self.cmdctl._httpserver = Server
         answer = self.cmdctl.command_handler('shutdown', None)
         answer = self.cmdctl.command_handler('shutdown', None)
         rcode, msg = ccsession.parse_answer(answer)
         rcode, msg = ccsession.parse_answer(answer)
         self.assertEqual(rcode, 0)
         self.assertEqual(rcode, 0)
         self.assertIsNone(msg)
         self.assertIsNone(msg)
+        self.assertTrue(['shutdown'], called)
 
 
     def test_command_handler_spec_update(self):
     def test_command_handler_spec_update(self):
         # Should not be present
         # Should not be present