def test_encrypt_apikey_auth():
    'Send an encryped apikey and decrypt it.'
    with mocks.Server() as server:
        assemblyline_client.get_client(server.address, verify=False, apikey=('username', 'ANAPIKEY'))
        assert (len(server.logins) == 1)
        assert (server.logins[0]['user'] == 'username')
        assert (server.logins[0]['apikey'] != 'ANAPIKEY')
        assert (server.private_key.decrypt(b64decode(server.logins[0]['apikey']), 'ERROR') == b'ANAPIKEY')
Send an encryped apikey and decrypt it.
def test_encrypt_apikey_auth():
    
    with mocks.Server() as server:
        assemblyline_client.get_client(server.address, verify=False, apikey=('username', 'ANAPIKEY'))
        assert (len(server.logins) == 1)
        assert (server.logins[0]['user'] == 'username')
        assert (server.logins[0]['apikey'] != 'ANAPIKEY')
        assert (server.private_key.decrypt(b64decode(server.logins[0]['apikey']), 'ERROR') == b'ANAPIKEY')