def build_same_files_and_dirs(tmpdir, source_is_symlink, dest_is_symlink, use_files):
"""Build temporary files or directories to test indication of same source and destination.
:param bool source_is_symlink: Should the source be a symlink to the destination (both cannot be True)
:param bool dest is symlink: Should the destination be a symlink to the source (both cannot be True)
:param bool use_files: Should files be created (if False, directories are used instead)
"""
if use_files:
real = tmpdir.join('real')
real.write('some data')
else:
real = tmpdir.mkdir('real')
link = tmpdir.join('link')
if source_is_symlink or dest_is_symlink:
os.symlink(str(real), str(link))
if source_is_symlink:
return str(link), str(real)
elif dest_is_symlink:
return str(real), str(link)
return str(real), str(real)
test_aws_encryption_sdk_cli.py 文件源码
python
阅读 33
收藏 0
点赞 0
评论 0
评论列表
文章目录