renamem orders
This commit is contained in:
28
orders-events/tests/events/test_remove_slots_if_canceled.py
Normal file
28
orders-events/tests/events/test_remove_slots_if_canceled.py
Normal file
@@ -0,0 +1,28 @@
|
||||
from aws_lambda_powertools.utilities.typing import LambdaContext
|
||||
from layercake.dynamodb import DynamoDBPersistenceLayer, PartitionKey
|
||||
|
||||
import events.remove_slots_if_canceled as app
|
||||
|
||||
|
||||
def test_remove_slots_if_canceled(
|
||||
dynamodb_seeds,
|
||||
dynamodb_persistence_layer: DynamoDBPersistenceLayer,
|
||||
lambda_context: LambdaContext,
|
||||
):
|
||||
event = {
|
||||
'detail': {
|
||||
'new_image': {
|
||||
'id': '9omWNKymwU5U4aeun6mWzZ',
|
||||
'status': 'CANCELED',
|
||||
'tenant_id': 'cJtK9SsnJhKPyxESe7g3DG',
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
assert app.lambda_handler(event, lambda_context) # type: ignore
|
||||
|
||||
r = dynamodb_persistence_layer.collection.query(
|
||||
PartitionKey('vacancies#cJtK9SsnJhKPyxESe7g3DG')
|
||||
)
|
||||
|
||||
assert len(r['items']) == 0
|
||||
Reference in New Issue
Block a user