From c6461d8d83d5f086aee978ab08116b0024aab939 Mon Sep 17 00:00:00 2001 From: Siddharth Ravikumar Date: Thu, 19 Mar 2015 22:32:16 -0400 Subject: 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 --- tests/utils.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests/utils.py') 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) -- cgit v1.2.3