Commits

Jason R. Coombs committed e3cf153

Pass command line as distinct parameters and let subprocess handle constructing a string.

  • Participants
  • Parent commits aa9cae1

Comments (0)

Files changed (1)

eggmonster/test/test_spawn.py

     def test_fake_monster_spawn(self):
         config_file = os.path.join(os.path.dirname(__file__),
             'test_spawn_flat.yaml')
-        output = subprocess.check_output(
-            './fake-monster sum_app.do_sum --config-path=%s 10'
-            % config_file, shell=True, env=self.env)
+        command = [
+            './fake-monster',
+            'sum_app.do_sum',
+            '--config-path', config_file,
+            '10',
+        ]
+        output = subprocess.check_output(command, env=self.env, shell=True)
         assert output == '18'
 
     def test_monster_run_spawn(self):
         config_file = os.path.join(os.path.dirname(__file__),
             'test_spawn_struct.yaml')
-        output = subprocess.check_output(
-            './monster_run %s sum_app.do_sum ! 10' % config_file,
-            shell=True, env=self.env)
+        command = [
+            './monster_run',
+            config_file, 'sum_app.do_sum', '!', '10',
+        ]
+        output = subprocess.check_output(command, env=self.env, shell=True)
         assert output == '18'