Example #1
0
def test_encrypt_decrypt_string_flex():
    clear_text = "This is a secret message."

    cipher_arr = mbc.encrypts(clear_text, url, METHOD_FLEX)

    msg = mbc.decrypts(cipher_arr, url, METHOD_FLEX)

    assert msg == clear_text
Example #2
0
def test_encrypt_decrypt_string_fast():
    clear_text = "This is a secret message."

    cipher_arr = mbc.encrypts(clear_text, url, METHOD_FAST)

    msg = mbc.decrypts(cipher_arr, url, METHOD_FAST)

    assert msg == clear_text.lower()
Example #3
0
def test_encrypts_missing_url():
    with pytest.raises(ValueError):
        mbc.encrypts("Hello World", "")
Example #4
0
def test_encrypts_missing_message():
    with pytest.raises(ValueError):
        mbc.encrypts("", url)