def get_eggs_paths(): import vim_bridge vimpdb_path = config.get_package_path(errors.ReturnCodeError()) vim_bridge_path = config.get_package_path(vim_bridge.bridged) return ( os.path.dirname(vimpdb_path), os.path.dirname(vim_bridge_path), )
def build_script(script): """make path to scripts used by tests """ from vimpdb.config import get_package_path tests_path = get_package_path(build_script) script_path = sys.executable + " " + os.path.sep.join([tests_path, 'scripts', script]) return script_path
def build_script(script): """make path to scripts used by tests """ from vimpdb.config import get_package_path tests_path = get_package_path(build_script) script_path = sys.executable + " " + os.path.sep.join( [tests_path, 'scripts', script]) return script_path
def setupRemote(self): if not self.isRemoteSetup(): # source vimpdb.vim proxy_package_path = config.get_package_path(self) filename = os.path.join(proxy_package_path, "vimpdb.vim") command = "<C-\><C-N>:source %s<CR>" % filename self._send(command) for egg_path in get_eggs_paths(): self._send(":call PDB_setup_egg(%s)<CR>" % repr(egg_path)) self._send(":call PDB_init_controller()")
def setupRemote(self): if not self.isRemoteSetup(): # source vimpdb.vim proxy_package_path = config.get_package_path(self) filename = os.path.join(proxy_package_path, "vimpdb.vim") command = "<C-\><C-N>:source %s<CR>" % filename self._send(command) for egg_path in get_eggs_paths(): self._send(':call PDB_setup_egg(%s)<CR>' % repr(egg_path)) self._send(':call PDB_init_controller()')
def test_ProxyToVim_showFileAtLine_existing_file(): 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) 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]