wip reporting
This commit is contained in:
0
order-events/tests/events/reporting/__init__.py
Normal file
0
order-events/tests/events/reporting/__init__.py
Normal file
30
order-events/tests/events/reporting/test_add_item.py
Normal file
30
order-events/tests/events/reporting/test_add_item.py
Normal file
@@ -0,0 +1,30 @@
|
||||
from aws_lambda_powertools.utilities.typing import LambdaContext
|
||||
from layercake.dynamodb import DynamoDBPersistenceLayer, PartitionKey
|
||||
|
||||
import events.reporting.add_item as app
|
||||
|
||||
|
||||
def test_add_item(
|
||||
dynamodb_seeds,
|
||||
dynamodb_persistence_layer: DynamoDBPersistenceLayer,
|
||||
lambda_context: LambdaContext,
|
||||
):
|
||||
event = {
|
||||
'detail': {
|
||||
'new_image': {
|
||||
'id': '945e8672-1d72-45c6-b76c-ac06aa8b52ab',
|
||||
'sk': 'METADATA#BILLING_TERMS',
|
||||
'billing_day': 5,
|
||||
'created_at': '2025-07-23T18:09:22.785678-03:00',
|
||||
'org_id': 'edp8njvgQuzNkLx2ySNfAD',
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
assert app.lambda_handler(event, lambda_context) # type: ignore
|
||||
|
||||
r = dynamodb_persistence_layer.collection.query(
|
||||
PartitionKey('BILLING#ORG#edp8njvgQuzNkLx2ySNfAD')
|
||||
)
|
||||
|
||||
print(r)
|
||||
Reference in New Issue
Block a user