def test_run_one_command(self): svc_adapter = DefaultRemoteSvcAdapter(self.p, self.c) command_to_succeed = "true" succeeded = svc_adapter._run_one_cmd(command_to_succeed) assert succeeded non_existant_command = "a4f6d2f32r22c3c34c423c2f2g34" succeeded = svc_adapter._run_one_cmd(non_existant_command) assert not succeeded command_to_fail = "cat fsdbjkfsdy89fsdy89fsfsdfsdfsd" succeeded = svc_adapter._run_one_cmd(command_to_fail) assert not succeeded
def test_run_one_command_timeout(self): """ This tests _run_one_command's timeout feature, so you may want to skip it when running these tests frequently. """ command_that_will_timeout = "sleep 10000" svc_adapter = DefaultRemoteSvcAdapter(self.p, self.c) succeeded = svc_adapter._run_one_cmd(command_that_will_timeout) assert not succeeded