summaryrefslogtreecommitdiff
path: root/test/path.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/path.py')
-rw-r--r--test/path.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/path.py b/test/path.py
new file mode 100644
index 0000000..38c0991
--- /dev/null
+++ b/test/path.py
@@ -0,0 +1,16 @@
+import os
+import tempfile
+import shutil
+
+
+def temppath(*paths):
+ return os.path.join(tempfile.gettempdir(), *paths)
+
+
+def move(src, dst):
+ if os.path.isfile(dst):
+ os.remove(dst)
+ elif os.path.isdir(dst):
+ shutil.rmtree(dst)
+ if os.path.exists(src):
+ os.rename(src, dst)