Example #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)
Example #2
0
File: mfs.py Project: Gerg/mockfs
    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)
Example #3
0
File: mfs.py Project: ogsy/mockfs
 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)
Example #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"], {})
Example #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'], {})
Example #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'], {})