def test_encrypt_decrypt_file_strict(clear_info): clear_filename, clear_text = clear_info outdata = mbc.encrypt(clear_filename, url, METHOD_STRICT) outfilename = "mbctest.mbc" if os.path.isfile(outfilename): # delete the previous output file os.unlink(outfilename) mbc.write(outfilename, outdata, METHOD_STRICT) msg = mbc.decrypt(outfilename, url) os.unlink(outfilename) assert msg == clear_text
def test_decrypt_missing_url(): with pytest.raises(ValueError): mbc.decrypt("filename.txt", "")
def test_decrypt_missing_filename(): with pytest.raises(ValueError): mbc.decrypt("", url)