import json
from http import HTTPMethod, HTTPStatus

from ..conftest import HttpApiProxy, LambdaContext


def test_lookup(
    mock_app,
    http_api_proxy: HttpApiProxy,
    lambda_context: LambdaContext,
):
    r = mock_app.lambda_handler(
        http_api_proxy(
            raw_path='/lookup/sergio@somosbeta.com.br',
            method=HTTPMethod.GET,
        ),
        lambda_context,
    )

    assert 'id' in json.loads(r['body'])
    assert r['statusCode'] == HTTPStatus.OK
