from http import HTTPMethod, HTTPStatus

from layercake.dynamodb import DynamoDBPersistenceLayer

from ...conftest import HttpApiProxy, LambdaContext


def test_scheduled_proceed(
    app,
    seeds,
    http_api_proxy: HttpApiProxy,
    dynamodb_persistence_layer: DynamoDBPersistenceLayer,
    lambda_context: LambdaContext,
):
    r = app.lambda_handler(
        http_api_proxy(
            raw_path='/orgs/cJtK9SsnJhKPyxESe7g3DG/enrollments/scheduled/proceed',
            method=HTTPMethod.POST,
            body={
                'scheduled_for': '2028-12-16T00:00:00-03:06',
                'lock_hash': '981ddaa78ffaf9a1074ab1169893f45d',
            },
        ),
        lambda_context,
    )
    print(r)
    assert r['statusCode'] == HTTPStatus.CREATED
