Beispiel #1
0
    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)
Beispiel #2
0
    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)
Beispiel #3
0
 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)
Beispiel #4
0
    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"], {})
Beispiel #5
0
    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'], {})
Beispiel #6
0
    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'], {})