fix bug
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
import app.events.schedule_reminders as app
|
||||
from aws_lambda_powertools.utilities.typing import LambdaContext
|
||||
from layercake.dynamodb import (
|
||||
DynamoDBPersistenceLayer,
|
||||
PartitionKey,
|
||||
)
|
||||
|
||||
|
||||
def test_schedule_reminders(
|
||||
seeds,
|
||||
dynamodb_persistence_layer: DynamoDBPersistenceLayer,
|
||||
lambda_context: LambdaContext,
|
||||
):
|
||||
event = {
|
||||
'detail': {
|
||||
'new_image': {
|
||||
'id': '14682b79-3df2-4351-9229-8b558af046a0',
|
||||
'sk': '0',
|
||||
'user': {
|
||||
'id': '1234',
|
||||
'name': 'Ozzy Orbourne',
|
||||
'email': 'ozzy@osbourne.com',
|
||||
},
|
||||
'course': {
|
||||
'id': '12334',
|
||||
'name': 'pytest',
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
assert app.lambda_handler(event, lambda_context) # type: ignore
|
||||
|
||||
r = dynamodb_persistence_layer.collection.query(
|
||||
PartitionKey('14682b79-3df2-4351-9229-8b558af046a0')
|
||||
)
|
||||
assert len(r['items']) == 4
|
||||
|
||||
Reference in New Issue
Block a user