Show More
@@ -308,7 +308,7 b' def get_ipython_dir():' | |||
|
308 | 308 | " using a temp directory."%ipdir) |
|
309 | 309 | ipdir = tempfile.mkdtemp() |
|
310 | 310 | elif not os.path.exists(ipdir): |
|
311 |
parent = |
|
|
311 | parent, _ = os.path.split(ipdir) | |
|
312 | 312 | if not _writable_dir(parent): |
|
313 | 313 | # ipdir does not exist and parent isn't writable |
|
314 | 314 | warnings.warn("IPython parent '%s' is not a writable location," |
@@ -295,6 +295,17 b' def test_get_ipython_dir_7():' | |||
|
295 | 295 | ipdir = path.get_ipython_dir() |
|
296 | 296 | nt.assert_equal(ipdir, os.path.join(home_dir, 'somewhere')) |
|
297 | 297 | |
|
298 | @with_environment | |
|
299 | def test_get_ipython_dir_8(): | |
|
300 | """test_get_ipython_dir_8, test / home directory""" | |
|
301 | old = path._writable_dir, path.get_xdg_dir | |
|
302 | try: | |
|
303 | path._writable_dir = lambda path: bool(path) | |
|
304 | path.get_xdg_dir = lambda: None | |
|
305 | env['HOME'] = '/' | |
|
306 | nt.assert_equal(path.get_ipython_dir(), '/.ipython') | |
|
307 | finally: | |
|
308 | path._writable_dir, path.get_xdg_dir = old | |
|
298 | 309 | |
|
299 | 310 | @with_environment |
|
300 | 311 | def test_get_xdg_dir_0(): |
|
1 | NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now