Show More
@@ -8,6 +8,7 b'' | |||
|
8 | 8 | import os |
|
9 | 9 | |
|
10 | 10 | from IPython.utils.tempdir import NamedFileInTemporaryDirectory |
|
11 | from IPython.utils.tempdir import TemporaryWorkingDirectory | |
|
11 | 12 | |
|
12 | 13 | |
|
13 | 14 | def test_named_file_in_temporary_directory(): |
@@ -18,3 +19,10 b' def test_named_file_in_temporary_directory():' | |||
|
18 | 19 | file.write(b'test') |
|
19 | 20 | assert file.closed |
|
20 | 21 | assert not os.path.exists(name) |
|
22 | ||
|
23 | def test_temporary_working_directory(): | |
|
24 | with TemporaryWorkingDirectory() as dir: | |
|
25 | assert os.path.exists(dir) | |
|
26 | assert os.path.abspath(os.curdir) == dir | |
|
27 | assert not os.path.exists(dir) | |
|
28 | assert os.path.abspath(os.curdir) != dir |
General Comments 0
You need to be logged in to leave comments.
Login now