Browse Source

[213] Drop single-line function

Michal 'vorner' Vaner 13 years ago
parent
commit
b108bc9f92
2 changed files with 13 additions and 12 deletions
  1. 1 5
      src/bin/bind10/bind10_src.py.in
  2. 12 7
      src/bin/bind10/tests/bind10_test.py.in

+ 1 - 5
src/bin/bind10/bind10_src.py.in

@@ -609,10 +609,6 @@ class BoB:
         self.__started = True
         return None
 
-    def stop_all_processes(self):
-        """Stop all processes."""
-        self._component_configurator.shutdown()
-
     def stop_process(self, process, recipient):
         """
         Stop the given process, friendly-like. The process is the name it has
@@ -642,7 +638,7 @@ class BoB:
         self.__stopping = True
         # first try using the BIND 10 request to stop
         try:
-            self.stop_all_processes()
+            self._component_configurator.shutdown()
         except:
             pass
         # XXX: some delay probably useful... how much is uncertain

+ 12 - 7
src/bin/bind10/tests/bind10_test.py.in

@@ -302,14 +302,9 @@ class TestBossComponents(unittest.TestCase):
         # Check it rejected it
         self.assertEqual(1, result['result'][0])
 
-        # Stop it
-        orig = bob._component_configurator.shutdown
-        bob._component_configurator.shutdown = self.__nullary_hook
-        self.__called = False
         # We can't call shutdown, that one relies on the stuff in main
-        bob.stop_all_processes()
-        bob._component_configurator.shutdown = orig
-        self.assertTrue(self.__called)
+        # We check somewhere else that the shutdown is actually called
+        # from there (the test_kills).
 
     def test_kills(self):
         """
@@ -333,8 +328,18 @@ class TestBossComponents(unittest.TestCase):
                 return "Immortal"
         bob.processes = {}
         bob.register_process(1, ImmortalComponent())
+
+        # While at it, we check the configurator shutdown is actually called
+        orig = bob._component_configurator.shutdown
+        bob._component_configurator.shutdown = self.__nullary_hook
+        self.__called = False
+
         bob.shutdown()
+
         self.assertEqual([False, True], killed)
+        self.assertTrue(self.__called)
+
+        bob._component_configurator.shutdown = orig
 
     def test_init_config(self):
         """