##// END OF EJS Templates
More work addressing review comments for Fernando's branch....
More work addressing review comments for Fernando's branch. * :mod:`IPython.testing.globalipapp` now directly creates a :class:`~IPython.core.iplib.InteractiveShell` instance by passing it a configuration object, rather than creating an IPython application. * Updated everything in :mod:`IPython.frontend` and :mod:`IPython.gui` to use raw :class:`~IPython.core.iplib.InteractiveShell directly rather than creating an IPython application. * Updated the IPython sphinx extension to use raw :class:`~IPython.core.iplib.InteractiveShell directly rather than creating an IPython application. * Removed code from :mod:`IPython.extensions.pretty` that called :func:`get_ipython` (r1271). * Addressed comment on (r1284) about holding refs to deferreds in :mod:`IPython.kernel.ipclusterapp`. * Removed :mod:`IPython.kernel` from list of modules tested by nose in :mod:`IPython.testing.iptest`. (r1318)

File last commit:

r2498:3eae1372
r2499:58bf4021
Show More
test_process.py
62 lines | 1.8 KiB | text/x-python | PythonLexer
# encoding: utf-8
"""
Tests for platutils.py
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2009 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
import sys
import nose.tools as nt
from IPython.utils.process import find_cmd, FindCmdError
from IPython.testing import decorators as dec
#-----------------------------------------------------------------------------
# Tests
#-----------------------------------------------------------------------------
def test_find_cmd_python():
"""Make sure we find sys.exectable for python."""
nt.assert_equals(find_cmd('python'), sys.executable)
@dec.skip_win32
def test_find_cmd_ls():
"""Make sure we can find the full path to ls."""
path = find_cmd('ls')
nt.assert_true(path.endswith('ls'))
def has_pywin32():
try:
import win32api
except ImportError:
return False
return True
@dec.onlyif(has_pywin32, "This test requires win32api to run")
def test_find_cmd_pythonw():
"""Try to find pythonw on Windows."""
path = find_cmd('pythonw')
nt.assert_true(path.endswith('pythonw.exe'))
@dec.onlyif(lambda : sys.platform != 'win32' or has_pywin32(),
"This test runs on posix or in win32 with win32api installed")
def test_find_cmd_fail():
"""Make sure that FindCmdError is raised if we can't find the cmd."""
nt.assert_raises(FindCmdError,find_cmd,'asdfasdf')