import json
from http import HTTPMethod, HTTPStatus

from ..conftest import HttpApiProxy, LambdaContext


def test_get_enrollment(
    app,
    seeds,
    http_api_proxy: HttpApiProxy,
    lambda_context: LambdaContext,
):
    r = app.lambda_handler(
        http_api_proxy(
            raw_path='/enrollments/578ec87f-94c7-4840-8780-bb4839cc7e64',
            method=HTTPMethod.GET,
        ),
        lambda_context,
    )
    assert r['statusCode'] == HTTPStatus.OK

    body = json.loads(r['body'])
    assert 'user' in body
    assert 'course' in body
