summaryrefslogtreecommitdiffstats
path: root/tests/file_test.py
diff options
context:
space:
mode:
authorSiddharth Ravikumar <sravik@bgsu.edu>2015-03-04 21:26:42 -0500
committerSiddharth Ravikumar <sravik@bgsu.edu>2015-03-04 21:26:42 -0500
commita76fa564e461c310360575c74dc8bfba3d1bda74 (patch)
treec5250683dfdada2760de614142f32d188d4ffc1a /tests/file_test.py
parent8b4c2404270ee4d3db33e9dd4d7c0590dafd7411 (diff)
renamed combox.file.rm_dir -> combox.file.rm_path
rm_path deletes a file or an empty directory. updated the test for it too. modified: tests/file_test.py
Diffstat (limited to 'tests/file_test.py')
-rw-r--r--tests/file_test.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/file_test.py b/tests/file_test.py
index ccd54b0..0e19e60 100644
--- a/tests/file_test.py
+++ b/tests/file_test.py
@@ -22,6 +22,7 @@ from hashlib import sha512
from glob import glob
from nose.tools import *
from os import path, remove
+from shutil import copyfile
from combox.config import get_nodedirs
from combox.crypto import split_and_encrypt
@@ -154,13 +155,20 @@ class TestFile(object):
assert foo_nodedir == node_path(foo_dir, self.config)
- def test_rmdir(self):
- """Tests rm_dir function"""
+ def test_rmpath(self):
+ """Tests rm_path function"""
new_dir = path.join(self.config['combox_dir'], 'fooius')
os.mkdir(new_dir)
assert path.isdir(new_dir)
- rm_dir(new_dir)
+ new_file = path.join(new_dir, 'fooius.ext')
+ copyfile(self.TEST_FILE, new_file)
+ assert path.isfile(new_file)
+
+ rm_path(new_file)
+ assert not path.isfile(new_file)
+
+ rm_path(new_dir)
assert not path.isdir(new_dir)