Show More
@@ -2,8 +2,6 b'' | |||
|
2 | 2 | import sys |
|
3 | 3 | from unittest import mock |
|
4 | 4 | |
|
5 | import nose.tools as nt | |
|
6 | ||
|
7 | 5 | from IPython import get_ipython |
|
8 | 6 | from IPython.lib import editorhooks |
|
9 | 7 | |
@@ -20,15 +18,15 b' def test_install_editor():' | |||
|
20 | 18 | with mock.patch('subprocess.Popen', fake_popen): |
|
21 | 19 | get_ipython().hooks.editor('the file', 64) |
|
22 | 20 | |
|
23 |
|
|
|
24 |
args = called[0][ |
|
|
25 |
kwargs = called[0][ |
|
|
26 | ||
|
27 |
|
|
|
28 | ||
|
29 |
if sys.platform.startswith( |
|
|
30 |
expected = [ |
|
|
21 | assert len(called) == 1 | |
|
22 | args = called[0]["args"] | |
|
23 | kwargs = called[0]["kwargs"] | |
|
24 | ||
|
25 | assert kwargs == {"shell": True} | |
|
26 | ||
|
27 | if sys.platform.startswith("win"): | |
|
28 | expected = ["foo", "-l", "64", "-f", "the file"] | |
|
31 | 29 | else: |
|
32 | 30 | expected = "foo -l 64 -f 'the file'" |
|
33 | 31 | cmd = args[0] |
|
34 |
|
|
|
32 | assert cmd == expected |
General Comments 0
You need to be logged in to leave comments.
Login now