test_i_aws_encryption_sdk_cli.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:aws-encryption-sdk-cli 作者: awslabs 项目源码 文件源码
def test_file_overwrite_source_dir_to_dir_custom_empty_prefix(tmpdir):
    plaintext_source = os.urandom(2014)
    plaintext = tmpdir.join('source_plaintext')
    with open(str(plaintext), 'wb') as f:
        f.write(plaintext_source)

    encrypt_args = encrypt_args_template().format(
        source=str(tmpdir),
        target=str(tmpdir)
    ) + ' --suffix'

    test_result = aws_encryption_sdk_cli.cli(shlex.split(encrypt_args, posix=not is_windows()))

    assert test_result == 'Destination and source cannot be the same'

    with open(str(plaintext), 'rb') as f:
        assert f.read() == plaintext_source
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号