RESOLVED WONTFIX 171268
Rename MockFileSystem.maybe_make_directory()
https://bugs.webkit.org/show_bug.cgi?id=171268
Summary Rename MockFileSystem.maybe_make_directory()
Carlos Alberto Lopez Perez
Reported 2017-04-25 03:36:15 PDT
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"
Attachments
Michael Catanzaro
Comment 1 2017-04-25 07:29:05 PDT
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. :)
Carlos Alberto Lopez Perez
Comment 2 2017-04-25 08:57:30 PDT
(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.
Note You need to log in before you can comment on or make changes to this bug.