summaryrefslogtreecommitdiffstats
path: root/multivimbroker
diff options
context:
space:
mode:
authorLiang Ke <lokyse@163.com>2018-03-27 02:25:17 +0000
committerGerrit Code Review <gerrit@onap.org>2018-03-27 02:25:17 +0000
commitb4eee071271ad4106bdbe486f58ae59ea46e2fc2 (patch)
tree5a29a21f6fd923cd165f494ab29f962f4af06bbe /multivimbroker
parentf39ef8fb3f092b25e4fdf9bd2ca9623008b4d8f4 (diff)
parentdcdca06c97e6b3c9b603b1e002384fb5122cf8ec (diff)
Merge "Add test_delete_dirs_success"
Diffstat (limited to 'multivimbroker')
-rw-r--r--multivimbroker/multivimbroker/tests/test_fileutil.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/multivimbroker/multivimbroker/tests/test_fileutil.py b/multivimbroker/multivimbroker/tests/test_fileutil.py
index 9bc48a6..521c3b4 100644
--- a/multivimbroker/multivimbroker/tests/test_fileutil.py
+++ b/multivimbroker/multivimbroker/tests/test_fileutil.py
@@ -32,3 +32,11 @@ class TestFileutil(unittest.TestCase):
mock_exists.return_value = False
fileutil.make_dirs(new_path)
mock_mkdir.assert_called_once_with(new_path, 0777)
+
+ @mock.patch.object(os.path, "exists")
+ @mock.patch("shutil.rmtree")
+ def test_delete_dirs_success(self, mock_rmtree, mock_exists):
+ mock_exists.return_value = True
+ new_path = "/tmp/tests"
+ fileutil.delete_dirs(new_path)
+ mock_rmtree.assert_called_once_with(new_path)