@@ -576,6 +576,12 @@ def path(self) -> AnyStr:
576576 dir_path = sep .join (names )
577577 return self .filesystem .absnormpath (dir_path )
578578
579+ if sys .version_info >= (3 , 12 ):
580+
581+ @property
582+ def is_junction (self ) -> bool :
583+ return self .filesystem .isjunction (self .path )
584+
579585 def __getattr__ (self , item : str ) -> Any :
580586 """Forward some properties to stat_result."""
581587 if item in self .stat_types :
@@ -3440,6 +3446,12 @@ def islink(self, path: AnyPath) -> bool:
34403446 """
34413447 return self ._is_of_type (path , S_IFLNK , follow_symlinks = False )
34423448
3449+ if sys .version_info >= (3 , 12 ):
3450+
3451+ def isjunction (self , path : AnyPath ) -> bool :
3452+ """Returns False. Junctions are never faked."""
3453+ return False
3454+
34433455 def confirmdir (
34443456 self , target_directory : AnyStr , check_owner : bool = False
34453457 ) -> FakeDirectory :
@@ -3589,7 +3601,7 @@ def dir() -> List[str]:
35893601 """Return the list of patched function names. Used for patching
35903602 functions imported from the module.
35913603 """
3592- return [
3604+ dir_list = [
35933605 "abspath" ,
35943606 "dirname" ,
35953607 "exists" ,
@@ -3613,6 +3625,9 @@ def dir() -> List[str]:
36133625 "splitdrive" ,
36143626 "samefile" ,
36153627 ]
3628+ if sys .version_info >= (3 , 12 ):
3629+ dir_list .append ("isjunction" )
3630+ return dir_list
36163631
36173632 def __init__ (self , filesystem : FakeFilesystem , os_module : "FakeOsModule" ):
36183633 """Init.
@@ -3702,6 +3717,12 @@ def islink(self, path: AnyStr) -> bool:
37023717 """
37033718 return self .filesystem .islink (path )
37043719
3720+ if sys .version_info >= (3 , 12 ):
3721+
3722+ def isjunction (self , path : AnyStr ) -> bool :
3723+ """Returns False. Junctions are never faked."""
3724+ return self .filesystem .isjunction (path )
3725+
37053726 def getmtime (self , path : AnyStr ) -> float :
37063727 """Returns the modification time of the fake file.
37073728
0 commit comments