27 lines
729 B
Python
27 lines
729 B
Python
import app.events.enroll as app
|
|
from aws_lambda_powertools.utilities.typing import LambdaContext
|
|
from layercake.dynamodb import DynamoDBPersistenceLayer, PartitionKey
|
|
|
|
|
|
def test_enroll(
|
|
dynamodb_seeds,
|
|
dynamodb_client,
|
|
dynamodb_persistence_layer: DynamoDBPersistenceLayer,
|
|
lambda_context: LambdaContext,
|
|
):
|
|
event = {
|
|
'detail': {
|
|
'new_image': {
|
|
'id': 'cpYSbBcie2NDbZhDKCxCih',
|
|
'sk': 'generated_items',
|
|
}
|
|
}
|
|
}
|
|
ids = app.lambda_handler(event, lambda_context) # type: ignore
|
|
print(ids)
|
|
|
|
result = dynamodb_persistence_layer.collection.query(PartitionKey(str(ids[0])))
|
|
print(result)
|
|
|
|
# assert len(result['items']) == 4
|