コード例 #1
0
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__
コード例 #2
0
ファイル: test_ptk_multiline.py プロジェクト: VHarisop/xonsh
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__
コード例 #3
0
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,
    )
コード例 #4
0
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__
コード例 #5
0
ファイル: test_ptk_multiline.py プロジェクト: zofuthan/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__
コード例 #6
0
ファイル: test_ptk_multiline.py プロジェクト: minrk/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
コード例 #7
0
ファイル: test_ptk_multiline.py プロジェクト: blink1073/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