コード例 #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())
コード例 #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())