aboutsummaryrefslogtreecommitdiffstats
path: root/libbe
diff options
context:
space:
mode:
authorAaron Bentley <aaron.bentley@utoronto.ca>2005-03-24 06:03:04 +0000
committerAaron Bentley <aaron.bentley@utoronto.ca>2005-03-24 06:03:04 +0000
commit37157407c121ca6cdfb4beb726adb49303bf929e (patch)
treeca0f84550040d02a4f4b23b9aa50f6e06f91cf55 /libbe
parentfff94eaeaaf2c7b9d6c6b9ad559c779cbaa0c5da (diff)
downloadbugseverywhere-37157407c121ca6cdfb4beb726adb49303bf929e.tar.gz
Added tests for set-root
Diffstat (limited to 'libbe')
-rw-r--r--libbe/tests.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/libbe/tests.py b/libbe/tests.py
new file mode 100644
index 0000000..ecd6ed5
--- /dev/null
+++ b/libbe/tests.py
@@ -0,0 +1,24 @@
+import tempfile
+import shutil
+import os
+import os.path
+cleanable = []
+def clean_up():
+ global cleanable
+ tmp = cleanable
+ tmp.reverse()
+ for obj in tmp:
+ obj.clean_up()
+ cleanable = []
+
+class Dir:
+ def __init__(self):
+ self.name = tempfile.mkdtemp(prefix="testdir")
+ cleanable.append(self)
+ def clean_up(self):
+ shutil.rmtree(self.name)
+
+def arch_dir():
+ dir = Dir()
+ os.mkdir(os.path.join(dir.name, "{arch}"))
+ return dir