def ctx(): """Context in which the ptk multiline functionality will be tested.""" builtins.__xonsh_env__ = DummyEnv() builtins.__xonsh_env__['INDENT'] = ' ' from xonsh.ptk2.key_bindings import carriage_return ptk_buffer = Buffer() ptk_buffer.accept_action = MagicMock(name='accept') cli = MagicMock(name='cli', spec=Application) yield Context(indent=' ', buffer=ptk_buffer, accept=ptk_buffer.accept_action, cli=cli, cr=carriage_return) del builtins.__xonsh_env__
def ctx(): """Context in which the ptk multiline functionality will be tested.""" builtins.__xonsh_env__ = DummyEnv() builtins.__xonsh_env__['INDENT'] = ' ' from xonsh.ptk.key_bindings import carriage_return ptk_buffer = Buffer() ptk_buffer.accept_action = MagicMock(name='accept', spec=AcceptAction) cli = MagicMock(name='cli', spec=CommandLineInterface) yield Context(indent=' ', buffer=ptk_buffer, accept=ptk_buffer.accept_action, cli=cli, cr=carriage_return) del builtins.__xonsh_env__
def ctx(xession): """Context in which the ptk multiline functionality will be tested.""" xession.env["INDENT"] = " " from xonsh.ptk_shell.key_bindings import carriage_return ptk_buffer = Buffer() ptk_buffer.accept_action = MagicMock(name="accept") cli = MagicMock(name="cli", spec=Application) yield Context( indent=" ", buffer=ptk_buffer, accept=ptk_buffer.accept_action, cli=cli, cr=carriage_return, )
def ctx(): """Context in which the ptk multiline functionality will be tested.""" builtins.__xonsh__ = XonshSession() builtins.__xonsh__.env = DummyEnv() builtins.__xonsh__.env["INDENT"] = " " from xonsh.ptk2.key_bindings import carriage_return ptk_buffer = Buffer() ptk_buffer.accept_action = MagicMock(name="accept") cli = MagicMock(name="cli", spec=Application) yield Context( indent=" ", buffer=ptk_buffer, accept=ptk_buffer.accept_action, cli=cli, cr=carriage_return, ) del builtins.__xonsh__.env del builtins.__xonsh__
def ctx(): """Context in which the ptk multiline functionality will be tested.""" builtins.__xonsh__ = XonshSession() builtins.__xonsh__.env = DummyEnv() builtins.__xonsh__.env["INDENT"] = " " from xonsh.ptk2.key_bindings import carriage_return ptk_buffer = Buffer() ptk_buffer.accept_action = MagicMock(name="accept") cli = MagicMock(name="cli", spec=Application) yield Context( indent=" ", buffer=ptk_buffer, accept=ptk_buffer.accept_action, cli=cli, cr=carriage_return, ) del builtins.__xonsh__.env del builtins.__xonsh__
def setup(): global indent_ global buffer global bufaccept global cli global carriage_return global builtins import builtins builtins.__xonsh_env__ = Env() builtins.__xonsh_env__['INDENT'] = ' ' from xonsh.ptk.key_bindings import carriage_return indent_ = ' ' buffer = Buffer() bufaccept = MagicMock(name='accept', spec=AcceptAction) cli = MagicMock(name='cli', spec=CommandLineInterface) buffer.accept_action = bufaccept
def setup(): global indent_ global buffer global bufaccept global cli global carriage_return global builtins import builtins builtins.__xonsh_env__ = Env() builtins.__xonsh_env__['INDENT'] = ' ' from xonsh.ptk.key_bindings import carriage_return indent_ = ' ' buffer = Buffer() bufaccept = MagicMock(name='accept', spec=AcceptAction) cli = MagicMock(name='cli', spec=CommandLineInterface) buffer.accept_action = bufaccept