summaryrefslogtreecommitdiff
path: root/test/path.py
diff options
context:
space:
mode:
authorSunaina Pai <sunainapai.in@gmail.com>2018-03-17 14:45:21 +0530
committerSunaina Pai <sunainapai.in@gmail.com>2018-03-17 14:45:21 +0530
commit62d0aa159fc046a27bed47e337d787a08f4687d0 (patch)
treec1162f14377890c290d2ad114b3892cbb9848975 /test/path.py
Add makesite: A simple static site generator
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)