Show More
@@ -318,6 +318,8 b' def get_ipython_dir():' | |||
|
318 | 318 | # not using XDG |
|
319 | 319 | ipdir = home_ipdir |
|
320 | 320 | |
|
321 | ipdir = os.path.normpath(os.path.expanduser(ipdir)) | |
|
322 | ||
|
321 | 323 | return _cast_unicode(ipdir, fs_encoding) |
|
322 | 324 | |
|
323 | 325 |
@@ -91,7 +91,7 b' def setup_environment():' | |||
|
91 | 91 | def teardown_environment(): |
|
92 | 92 | """Restore things that were remebered by the setup_environment function |
|
93 | 93 | """ |
|
94 | (oldenv, os.name, get_home_dir, IPython.__file__,) = oldstuff | |
|
94 | (oldenv, os.name, path.get_home_dir, IPython.__file__,) = oldstuff | |
|
95 | 95 | |
|
96 | 96 | for key in env.keys(): |
|
97 | 97 | if key not in oldenv: |
@@ -269,6 +269,7 b' def test_get_ipython_dir_4():' | |||
|
269 | 269 | @with_environment |
|
270 | 270 | def test_get_ipython_dir_5(): |
|
271 | 271 | """test_get_ipython_dir_5, use .ipython if exists and XDG defined, but doesn't exist.""" |
|
272 | path.get_home_dir = lambda : HOME_TEST_DIR | |
|
272 | 273 | os.name = "posix" |
|
273 | 274 | env.pop('IPYTHON_DIR', None) |
|
274 | 275 | env.pop('IPYTHONDIR', None) |
@@ -290,6 +291,15 b' def test_get_ipython_dir_6():' | |||
|
290 | 291 | nt.assert_equal(ipdir, xdg_ipdir) |
|
291 | 292 | |
|
292 | 293 | @with_environment |
|
294 | def test_get_ipython_dir_7(): | |
|
295 | """test_get_ipython_dir_7, test home directory expansion on IPYTHON_DIR""" | |
|
296 | home_dir = os.path.expanduser('~/') | |
|
297 | env['IPYTHON_DIR'] = '~/somewhere' | |
|
298 | ipdir = path.get_ipython_dir() | |
|
299 | nt.assert_equal(ipdir, os.path.join(home_dir, 'somewhere')) | |
|
300 | ||
|
301 | ||
|
302 | @with_environment | |
|
293 | 303 | def test_get_xdg_dir_1(): |
|
294 | 304 | """test_get_xdg_dir_1, check xdg_dir""" |
|
295 | 305 | reload(path) |
General Comments 0
You need to be logged in to leave comments.
Login now