def __init__(self, path_separator=os.path.sep, total_size=None,
                 patcher=None):
        """
        Args:
            path_separator:  optional substitute for os.path.sep
            total_size: if not None, the total size in bytes of the
                root filesystem.

        Example usage to emulate real file systems:

        >>> filesystem = FakeFilesystem(
        ...     alt_path_separator='/' if _is_windows else None)

        """
        self.path_separator = path_separator
        self.alternative_path_separator = os.path.altsep
        self.patcher = patcher
        if path_separator != os.sep:
            self.alternative_path_separator = None

        # is_windows_fs can be used to test the behavior of pyfakefs under
        # Windows fs on non-Windows systems and vice verse;
        # is it used to support drive letters, UNC paths and some other
        # Windows-specific features
        self.is_windows_fs = sys.platform == 'win32'

        # can be used to test some MacOS-specific behavior under other systems
        self.is_macos = sys.platform == 'darwin'

        # is_case_sensitive can be used to test pyfakefs for case-sensitive
        # file systems on non-case-sensitive systems and vice verse
        self.is_case_sensitive = not (self.is_windows_fs or self.is_macos)

        self.root = FakeDirectory(self.path_separator, filesystem=self)
        self.cwd = self.root.name

        # We can't query the current value without changing it:
        self.umask = os.umask(0o22)
        os.umask(self.umask)

        # A list of open file objects. Their position in the list is their
        # file descriptor number
        self.open_files = []
        # A heap containing all free positions in self.open_files list
        self._free_fd_heap = []
        # last used numbers for inodes (st_ino) and devices (st_dev)
        self._last_ino = 0
        self._last_dev = 0
        self.mount_points = {}
        self.add_mount_point(self.root.name, total_size)
        self._add_standard_streams()
        self.dev_null = FakeNullFile(self)
def __init__ ( self , path_separator = os . path . sep , total_size = None , patcher = None ) : self . path_separator = path_separator self . alternative_path_separator = os . path . altsep self . patcher = patcher if path_separator != os . sep : self . alternative_path_separator = None self . is_windows_fs = sys . platform == 'win32' self . is_macos = sys . platform == 'darwin' self . is_case_sensitive = not ( self . is_windows_fs or self . is_macos ) self . root = FakeDirectory ( self . path_separator , filesystem = self ) self . cwd = self . root . name self . umask = os . umask ( 0o22 ) os . umask ( self . umask ) self . open_files = [ ] self . _free_fd_heap = [ ] self . _last_ino = 0 self . _last_dev = 0 self . mount_points = { } self . add_mount_point ( self . root . name , total_size ) self . _add_standard_streams ( ) self . dev_null = FakeNullFile ( self )
Args:
            path_separator:  optional substitute for os.path.sep
            total_size: if not None, the total size in bytes of the
                root filesystem.

        Example usage to emulate real file systems:

        >>> filesystem = FakeFilesystem(
        ...     alt_path_separator='/' if _is_windows else None)