Exemplo n.º 1
0
def test_mysql_aes_decrypt():
    """Test mysql_aes_encrypt."""
    assert mysql_aes_decrypt(unhexlify(b'9e9ce44cd9df2b201f51947e03bccbe2'),
                             "key") == "test"
    assert mysql_aes_decrypt(unhexlify(u"9e9ce44cd9df2b201f51947e03bccbe2"),
                             u"key") == "test"
    pytest.raises(AssertionError, mysql_aes_decrypt, object(), "key")
    pytest.raises(AssertionError, mysql_aes_decrypt, "val", object())
Exemplo n.º 2
0
def test_mysql_aes_decrypt():
    """Test mysql_aes_encrypt."""
    assert mysql_aes_decrypt(
        unhexlify(b'9e9ce44cd9df2b201f51947e03bccbe2'), "key") == "test"
    assert mysql_aes_decrypt(
        unhexlify(u"9e9ce44cd9df2b201f51947e03bccbe2"), u"key") == "test"
    pytest.raises(AssertionError, mysql_aes_decrypt, object(), "key")
    pytest.raises(AssertionError, mysql_aes_decrypt, "val", object())