summaryrefslogtreecommitdiffstats
path: root/tests/utils.py
diff options
context:
space:
mode:
authorSiddharth Ravikumar <sravik@bgsu.edu>2015-03-19 22:32:16 -0400
committerSiddharth Ravikumar <sravik@bgsu.edu>2015-03-19 22:32:16 -0400
commitc6461d8d83d5f086aee978ab08116b0024aab939 (patch)
tree647873ed7ad62b94e693376b403587be44fb83dd /tests/utils.py
parent8b4f318e782b385d07a5e3cf7eb1160abcc1b5a7 (diff)
In tests, the code that purges the files/directories in `purge_list' is now a function.
modified: tests/events_test.py modified: tests/file_test.py modified: tests/utils.py
Diffstat (limited to 'tests/utils.py')
-rw-r--r--tests/utils.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/utils.py b/tests/utils.py
index b9de2c8..ef9f482 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -69,6 +69,16 @@ def rm_nodedirs(config):
print "Problem deleting", node, e
+def purge(l):
+ """ Purges everything in list `l'"""
+ for f in l:
+ if path.exists(f) and path.isfile(f):
+ remove(f)
+ elif path.exists(f) and path.isdir(f):
+ purge_dir(f)
+ rmdir(f)
+
+
def purge_nodedirs(config):
"""Purges everything inside node directories."""
nodes = get_nodedirs(config)