summaryrefslogtreecommitdiffstats
path: root/tests/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/util.py')
-rw-r--r--tests/util.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/util.py b/tests/util.py
index 1cbc4e312..cc761ce72 100644
--- a/tests/util.py
+++ b/tests/util.py
@@ -61,6 +61,14 @@ class TempDir(object):
assert path.isfile(f) and not path.islink(f)
return f
+ def write(self, content, *parts):
+ d = self.makedirs(*parts[:-1])
+ f = path.join(d, parts[-1])
+ assert not path.exists(f)
+ open(f, 'w').write(content)
+ assert path.isfile(f) and not path.islink(f)
+ return f
+
def join(self, *parts):
return path.join(self.path, *parts)