summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiang Ke <lokyse@163.com>2018-03-27 02:25:14 +0000
committerGerrit Code Review <gerrit@onap.org>2018-03-27 02:25:14 +0000
commitf39ef8fb3f092b25e4fdf9bd2ca9623008b4d8f4 (patch)
tree5c11d548681622f33bdb8ead47eebc7290ca3693
parent69433c339b8445665e3ef717604de485c763d7d4 (diff)
parentdb20d587b47b1a24689b2afb6459f202b04ceb01 (diff)
Merge "Add test_make_dirs_path_not_exists"
-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 8eb4a52..9bc48a6 100644
--- a/multivimbroker/multivimbroker/tests/test_fileutil.py
+++ b/multivimbroker/multivimbroker/tests/test_fileutil.py
@@ -24,3 +24,11 @@ class TestFileutil(unittest.TestCase):
mock_exists.return_value = True
fileutil.make_dirs(new_path)
mock_mkdir.assert_not_called()
+
+ @mock.patch.object(os.path, "exists")
+ @mock.patch("os.makedirs")
+ def test_make_dirs_path_not_exists(self, mock_mkdir, mock_exists):
+ new_path = "/tmp/test"
+ mock_exists.return_value = False
+ fileutil.make_dirs(new_path)
+ mock_mkdir.assert_called_once_with(new_path, 0777)