class TaskProcessRunnerTest(mox.MoxTestBase): def setUp(self): super(TaskProcessRunnerTest, self).setUp() self.process_runner = ProcessRunner() def test_command_execution_errors_will_cause_system_exit(self): """fab.tests.tasks.task_process_runner_test Command execution errors will cause a system exit""" with self.assertRaises(SystemExit) as raised: self.process_runner.execute('non_existent_command') self.assertTrue(raised.exception.code != 0)
def run_step(self, step_name, host_config_specification=None): exit_code = 0 deployment_script_path = os.path.join(DEPLOYMENT_STEPS_HOME, step_name + '.py') if host_config_specification: print '>> Running deployment step [%s] with host config specification [%s]' % ( step_name, host_config_specification) ProcessRunner().execute( [deployment_script_path, host_config_specification]) else: print '>> Running deployment step [%s]' % step_name ProcessRunner().execute(deployment_script_path)
def setUp(self): super(TaskProcessRunnerTest, self).setUp() self.process_runner = ProcessRunner()