The name maybe_make_directory is pretty confusing as it suggest the function may fail to create the directory. The function is this: def maybe_make_directory(self, *path): norm_path = self.normpath(self.join(*path)) while norm_path and not self.isdir(norm_path): self.dirs.add(norm_path) norm_path = self.dirname(norm_path) https://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/common/system/filesystem_mock.py?rev=215715#L279 So I understand it behaves exactly like "mkdir -p"
Hm, this is not what I meant. I assumed it was obvious that maybe_make_directory() functions like "mkdir -p". So I think the current name is fine. But we should have a function that operates like plain "mkdir" so that you can use it in tests in cases where the directory should definitely not already exist, as in bug #168036. This is very unimportant. :)
(In reply to Michael Catanzaro from comment #1) > Hm, this is not what I meant. I assumed it was obvious that > maybe_make_directory() functions like "mkdir -p". So I think the current > name is fine. > But we should have a function that operates like plain "mkdir" > so that you can use it in tests in cases where the directory should > definitely not already exist, as in bug #168036. > I don't think we need such function. If I want to ensure the directory doesn't exits I can test for that with MockFileSystem.isdir() I'll land a follow-up patch for that in bug 168036. > This is very unimportant. :) Ok. Let's close this then.