This commit is contained in:
2025-07-17 15:51:53 -03:00
parent b30b158917
commit 8821325e19
8 changed files with 95 additions and 13 deletions

View File

@@ -15,6 +15,7 @@ def pytest_configure():
os.environ['DYNAMODB_PARTITION_KEY'] = PK
os.environ['DYNAMODB_SORT_KEY'] = SK
os.environ['USER_TABLE'] = PYTEST_TABLE_NAME
os.environ['ENROLLMENT_TABLE'] = PYTEST_TABLE_NAME
os.environ['KONVIVA_API_URL'] = 'https://lms.saladeaula.digital'

View File

@@ -0,0 +1,18 @@
from aws_lambda_powertools.utilities.typing import LambdaContext
import events.enroll as app
def test_enroll(dynamodb_client, dynamodb_seeds, lambda_context: LambdaContext):
event = {
'detail': {
'new_image': {
'id': '03ad39c6-055e-48d8-acc8-e11385ed8904',
'sk': 'konviva',
'class_id': 275,
'user_id': 26943,
}
}
}
assert not app.lambda_handler(event, lambda_context) # type: ignore

View File

@@ -1 +1,2 @@
{"id": {"S": "123"}, "sk": {"S": "0"}}
{"id": {"S": "123"}, "sk": {"S": "0"}}
{"id": {"S": "03ad39c6-055e-48d8-acc8-e11385ed8904"}, "sk": {"S": "konviva"}, "user_id": {"N": "275"}, "class_id": {"N": "26943"}}