def makedirs(self, path): """Create directory entries for a path Raise OSError if the path already exists. """ path = self.abspath(path) entry = self._direntry(path) if entry is not None: raise _OSError(errno.EEXIST, path) new_entries = util.build_nested_dir_dict(path) util.merge_dicts(new_entries, self._entries)
def makedirs(self, path): """Create directory entries for a path""" path = self.abspath(path) new_entries = util.build_nested_dir_dict(path) util.merge_dicts(new_entries, self._entries)
def test_build_nested_dir_dict(self): nested = util.build_nested_dir_dict("/foo") self.assertEqual(nested["foo"], {}) nested = util.build_nested_dir_dict("/bar/baz") self.assertEqual(nested["bar"]["baz"], {})
def test_build_nested_dir_dict(self): nested = util.build_nested_dir_dict('/foo') self.assertEqual(nested['foo'], {}) nested = util.build_nested_dir_dict('/bar/baz') self.assertEqual(nested['bar']['baz'], {})