Browse Source

[2353] Rewrite test_start_simple() to use MockBob2

Mukund Sivaraman 12 years ago
parent
commit
da1b2d7dc0
1 changed files with 7 additions and 11 deletions
  1. 7 11
      src/bin/bind10/tests/bind10_test.py.in

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

@@ -1480,24 +1480,20 @@ class TestBossComponents(unittest.TestCase):
 
 
     def test_start_simple(self):
     def test_start_simple(self):
         '''Test simple process startup.'''
         '''Test simple process startup.'''
-        bob = BoB()
+        bob = MockBob2()
         bob.c_channel_env = {}
         bob.c_channel_env = {}
 
 
         # non-verbose case
         # non-verbose case
         bob.verbose = False
         bob.verbose = False
-        pi = bob.start_simple('/bin/true')
-        self.assertEqual('/bin/true', pi.name)
-        self.assertEqual(['/bin/true'], pi.args)
-        self.assertEqual({}, pi.env)
-        self.assertNotEqual(0, pi.pid)
+        bob.start_simple('/bin/true')
+        self.assertEqual('/bin/true', bob.started_process_name)
+        self.assertEqual(['/bin/true'], bob.started_process_args)
 
 
         # verbose case
         # verbose case
         bob.verbose = True
         bob.verbose = True
-        pi = bob.start_simple('/bin/true')
-        self.assertEqual('/bin/true', pi.name)
-        self.assertEqual(['/bin/true', '-v'], pi.args)
-        self.assertEqual({}, pi.env)
-        self.assertNotEqual(0, pi.pid)
+        bob.start_simple('/bin/true')
+        self.assertEqual('/bin/true', bob.started_process_name)
+        self.assertEqual(['/bin/true', '-v'], bob.started_process_args)
 
 
     # there is another test with this name (minus the digits), but both
     # there is another test with this name (minus the digits), but both
     # do different things.
     # do different things.