Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 3 additions & 26 deletions pyfakefs/fake_filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,8 +578,7 @@ def path(self) -> AnyStr:

@property
def is_junction(self) -> bool:
# TODO: implement junctions
return False
return self.filesystem.isjunction(self.path)

def __getattr__(self, item: str) -> Any:
"""Forward some properties to stat_result."""
Expand Down Expand Up @@ -3446,19 +3445,7 @@ def islink(self, path: AnyPath) -> bool:
return self._is_of_type(path, S_IFLNK, follow_symlinks=False)

def isjunction(self, path: AnyPath) -> bool:
"""Determine if path identifies a junction.

Args:
path: Path to filesystem object.

Returns:
`False` on posix systems.
`True` if path is a junction on Windows.

Raises:
TypeError: if path is None.
"""
# TODO: implement junction on Windows
"""Junction are never faked."""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: Junction -> Junctions.
You may also add something like "Returns False - junctions are never faked."

return False
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think for the time being it is ok to just return False here - I would adapt the description accordingly, though. Later, we may add some convenience function to make a junction in pyfakefs - as far as I can see, this is not possible in Python yet. We also need to adapt os.stat, os.lstat and possibly other functions that will support junctions.


def confirmdir(
Expand Down Expand Up @@ -3725,17 +3712,7 @@ def islink(self, path: AnyStr) -> bool:
return self.filesystem.islink(path)

def isjunction(self, path: AnyStr) -> bool:
"""Determine whether path is a junction.

Args:
path: Path to filesystem object.

Returns:
`True` if path is a junction.

Raises:
TypeError: if path is None.
"""
"""Junction are never faked."""
return self.filesystem.isjunction(path)

def getmtime(self, path: AnyStr) -> float:
Expand Down