Code Review
/
multicloud
/
framework.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
review
|
tree
raw
(from parent 1:
69433c3
)
Merge "Add test_make_dirs_path_not_exists"
author
Liang Ke
<lokyse@163.com>
Tue, 27 Mar 2018 02:25:14 +0000
(
02:25
+0000)
committer
Gerrit Code Review
<gerrit@onap.org>
Tue, 27 Mar 2018 02:25:14 +0000
(
02:25
+0000)
multivimbroker/multivimbroker/tests/test_fileutil.py
patch
|
blob
|
history
diff --git
a/multivimbroker/multivimbroker/tests/test_fileutil.py
b/multivimbroker/multivimbroker/tests/test_fileutil.py
index
8eb4a52
..
9bc48a6
100644
(file)
--- 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)