Skip to content
Snippets Groups Projects
Commit 68f203f0 authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

TEST: Test tempdir prefix option

parent e14e1c3b
No related branches found
No related tags found
No related merge requests found
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
# #
import glob
import os import os
import os.path as op import os.path as op
...@@ -53,6 +54,15 @@ def test_tempdir_changeto(): ...@@ -53,6 +54,15 @@ def test_tempdir_changeto():
assert op.realpath(os.getcwd()) == cwd assert op.realpath(os.getcwd()) == cwd
def test_tempdir_prefix():
with tempdir.tempdir(prefix='mytempdirtest') as tdir:
assert op.basename(tdir).startswith('mytempdirtest')
with tempdir.tempdir() as parent:
with tempdir.tempdir(prefix='mytempdirtest', root='.') as tdir:
assert list(glob.glob(op.join(parent, 'mytempdirtest*'))) == [tdir]
def test_tempdir_override(): def test_tempdir_override():
with tempdir.tempdir() as parent: with tempdir.tempdir() as parent:
override = op.abspath((op.join('override', 'directory'))) override = op.abspath((op.join('override', 'directory')))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment