##// END OF EJS Templates
Warn about .py/.json collisions in config...
Warn about .py/.json collisions in config when two versions of the config file set the same value, warn about clobbering, with a message, such as: ``` [TerminalIPythonApp] WARNING | Collisions detected in ipython_config.py and ipython_config.json config files. ipython_config.json has higher priority: { "Klass": { "trait": "'python' ignored, using 'json'" } } ``` In anticipation of more machine-written .json config

File last commit:

r18869:8cb6a801
r19160:f22c8070
Show More
test_editorhooks.py
37 lines | 929 B | text/x-python | PythonLexer
/ IPython / lib / tests / test_editorhooks.py
Min RK
fix editorhooks typo...
r18869 """Test installing editor hooks"""
import sys
try:
import mock
except ImportError:
from unittest import mock
import nose.tools as nt
from IPython import get_ipython
from IPython.lib import editorhooks
def test_install_editor():
called = []
def fake_popen(*args, **kwargs):
called.append({
'args': args,
'kwargs': kwargs,
})
editorhooks.install_editor('foo -l {line} -f {filename}', wait=False)
with mock.patch('subprocess.Popen', fake_popen):
get_ipython().hooks.editor('the file', 64)
nt.assert_equal(len(called), 1)
args = called[0]['args']
kwargs = called[0]['kwargs']
nt.assert_equal(kwargs, {'shell': True})
if sys.platform.startswith('win'):
expected = ['foo', '-l', '64', '-f', 'the file']
else:
expected = "foo -l 64 -f 'the file'"
cmd = args[0]
nt.assert_equal(cmd, expected)