fix slots
This commit is contained in:
26
enrollments-events/tests/events/test_allocate_slots.py
Normal file
26
enrollments-events/tests/events/test_allocate_slots.py
Normal file
@@ -0,0 +1,26 @@
|
||||
import app.events.allocate_slots as app
|
||||
from aws_lambda_powertools.utilities.typing import LambdaContext
|
||||
from layercake.dynamodb import DynamoDBPersistenceLayer, PartitionKey
|
||||
|
||||
|
||||
def test_allocate_slots(
|
||||
dynamodb_seeds,
|
||||
dynamodb_client,
|
||||
dynamodb_persistence_layer: DynamoDBPersistenceLayer,
|
||||
lambda_context: LambdaContext,
|
||||
):
|
||||
event = {
|
||||
'detail': {
|
||||
'new_image': {
|
||||
'id': 'JeCybf6oiv6CF3PchhBqdG',
|
||||
'sk': 'generated_items',
|
||||
}
|
||||
}
|
||||
}
|
||||
assert app.lambda_handler(event, lambda_context) # type: ignore
|
||||
|
||||
result = dynamodb_persistence_layer.collection.query(
|
||||
PartitionKey('vacancies#PWQyjGZeVcoD5zc5eTkvpr')
|
||||
)
|
||||
|
||||
assert len(result['items']) == 4
|
||||
Reference in New Issue
Block a user