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')
评论列表
文章目录