示例#1
0
def test_ProxyToVim_showFileAtLine_existing_file_windows():
    from vimpdb.proxy import ProxyToVim
    from vimpdb.proxy import Communicator
    from vimpdb.config import get_package_path

    existingFile = get_package_path(
        test_ProxyToVim_showFileAtLine_existing_file)
    existingFile = existingFile.replace(os.sep, '\\')

    communicator = Mock(spec=Communicator)
    communicator._remote_expr.return_value = '1'

    to_vim = ProxyToVim(communicator)
    to_vim._showFileAtLine(existingFile, 1)

    communicator._remote_expr.assert_called_with("exists('*PDB_setup_egg')")
    assert communicator._send.call_count == 1
    call_args, call_kwargs = communicator._send.call_args
    assert call_args[0].startswith(':call PDB_show_file_at_line("')
    assert call_args[0].endswith(' "1")<CR>')
    assert not '\\' in call_args[0]
示例#2
0
def test_ProxyToVim_showFileAtLine_existing_file_windows():
    from vimpdb.proxy import ProxyToVim
    from vimpdb.proxy import Communicator
    from vimpdb.config import get_package_path

    existingFile = get_package_path(
        test_ProxyToVim_showFileAtLine_existing_file)
    existingFile = existingFile.replace(os.sep, '\\')

    communicator = Mock(spec=Communicator)
    communicator._remote_expr.return_value = '1'

    to_vim = ProxyToVim(communicator)
    to_vim._showFileAtLine(existingFile, 1)

    communicator._remote_expr.assert_called_with("exists('*PDB_setup_egg')")
    assert communicator._send.call_count == 1
    call_args, call_kwargs = communicator._send.call_args
    assert call_args[0].startswith(':call PDB_show_file_at_line("')
    assert call_args[0].endswith(' "1")<CR>')
    assert not '\\' in call_args[0]