def test__default_goes_to_local(self): self.forge.replace(runner, "local") expected_result = runner.local.popen([self.SSH, self.host, "command"], shell=True).and_return( self.forge.create_sentinel() ) with self.forge.verified_replay_context(): result = runner.through_ssh(self.host).popen(["command"]) self.assertIs(result, expected_result)
def test__default_goes_to_local(self): self.forge.replace(runner, "local") expected_result = runner.local.popen([self.SSH, self.host, "command"], shell=True).and_return(self.forge.create_sentinel()) with self.forge.verified_replay_context(): result = runner.through_ssh(self.host).popen(["command"]) self.assertIs(result, expected_result)
def setUp(self): super(TestSSHPopen, self).setUp() self.host = "some_host" self.runner = self.forge.create_mock(runner.Runner) self.ssh_runner = runner.through_ssh(self.host, base_runner=self.runner)