예제 #1
0
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
예제 #2
0
def test_decrypt_missing_url():
    with pytest.raises(ValueError):
        mbc.decrypt("filename.txt", "")
예제 #3
0
def test_decrypt_missing_filename():
    with pytest.raises(ValueError):
        mbc.decrypt("", url)