utils.py 文件源码

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

项目:aumbry 作者: pyarmory 项目源码 文件源码
def can_save_an_encrypted_file(self):
        with tempfile.NamedTemporaryFile() as tp:
            save_temporary_config(
                './spec/cli/sample.yml',
                tp.name,
                test_key
            )

            with open(tp.name, 'rb') as fp:
                ct = fp.read()

        f = Fernet(test_key.encode('utf-8'))
        data = yaml.load(f.decrypt(ct))

        expect(data['thing']).to.equal('bam')
        expect(data['other']).to.equal('thing')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号