X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=multivimbroker%2Fmultivimbroker%2Ftests%2Ftest_fileutil.py;h=9bc48a6108dbcf9594b2780ec9815b35aef3d07e;hb=refs%2Fchanges%2F43%2F38543%2F1;hp=8eb4a5240d90b99ae61fbafb71464a56f35ed270;hpb=b39d394a88be55b9bcf385d8e6017d83ce2ab430;p=multicloud%2Fframework.git 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)