def new_fake_vagrant(self): return ExecutableStub('vagrant', stdout=textwrap.dedent(""" Host ignoredname HostName ahostname Port aport """))
def test_attach(where): """You can expoe yout local machine, a vagrant machine or another machine using ngrok""" command = Ngrok() ngrok = ExecutableStub('ngrok') with ngrok.inserted_as_shim(), where.fake_vagrant.inserted_as_shim(): command.do(['start'] + where.input_arguments.split()) assert ngrok.times_called == 1 assert ngrok.calls[0].argv == where.expected_commandline with ngrok.inserted_as_shim(), where.fake_vagrant.inserted_as_shim(): command.do(['start'] + where.input_arguments.split()+ ['-r', 'us', '-p', '1212']) assert ngrok.times_called == 2 assert ngrok.calls[1].argv == where.expected_full_args
def new_ssh_executable(self): return ExecutableStub('ssh')
def new_xpra_executable(self): return ExecutableStub('xpra')