summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
b39d394)
Add test_make_dirs_path_not_exists for fileutil.py
Change-Id: I00bbbb40801c0be49676daa6c7589e0844a09e6e
Issue-ID: MULTICLOUD-198
Signed-off-by: Ethan Lynn <ethanlynnl@vmware.com>
mock_exists.return_value = True
fileutil.make_dirs(new_path)
mock_mkdir.assert_not_called()
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)