File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -313,6 +313,19 @@ def testDirectoryDoesNotShadowSymlink(self):
313313 ]
314314 self .assertTarFileContent (self .tempfile , content )
315315
316+ def testSymlinkDoesNotShadowDirectory (self ):
317+ with tar_writer .TarFileWriter (self .tempfile , create_parents = True , allow_dups_from_deps = False ) as f :
318+ f .add_file ("target_dir" , tarfile .DIRTYPE )
319+ f .add_file ("not_a_symlink" , tarfile .DIRTYPE )
320+ f .add_file ("not_a_symlink" , tarfile .SYMTYPE , link = "target_dir" )
321+ f .add_file ('not_a_symlink/a' , content = "q" )
322+ content = [
323+ {"name" : "target_dir" , "type" : tarfile .DIRTYPE },
324+ {"name" : "not_a_symlink" , "type" : tarfile .DIRTYPE },
325+ {"name" : "not_a_symlink/a" , "type" : tarfile .REGTYPE },
326+ ]
327+ self .assertTarFileContent (self .tempfile , content )
328+
316329
317330if __name__ == "__main__" :
318331 unittest .main ()
You can’t perform that action at this time.
0 commit comments