add middleware

This commit is contained in:
2025-04-02 13:43:10 -03:00
parent 3a799fbbd1
commit 8cd755f0ae
14 changed files with 213 additions and 93 deletions

View File

@@ -5,9 +5,12 @@ from layercake.dynamodb import ComposeKey, DynamoDBCollection, PartitionKey
from ..conftest import HttpApiProxy, LambdaContext
YEAR_DAYS = 365
def test_post_course(
mock_app,
dynamodb_seeds,
dynamodb_persistence_layer,
http_api_proxy: HttpApiProxy,
lambda_context: LambdaContext,
@@ -19,9 +22,9 @@ def test_post_course(
headers={'X-Tenant': '*'},
body={
'name': 'pytest',
'access_period': 365,
'access_period': YEAR_DAYS,
'cert': {
'exp_interval': 730, # 2 years
'exp_interval': YEAR_DAYS * 2,
},
},
),
@@ -35,6 +38,6 @@ def test_post_course(
collect = DynamoDBCollection(dynamodb_persistence_layer)
logs = collect.get_items(
PartitionKey(ComposeKey('5OxmMjL-ujoR5IMGegQz', prefix='logs'))
PartitionKey(ComposeKey('5OxmMjL-ujoR5IMGegQz', prefix='log', delimiter=':'))
)
print(logs)

View File

@@ -36,9 +36,9 @@ def test_settings(
],
'tenants': [
{
'sk': 'cJtK9SsnJhKPyxESe7g3DG',
'sk': '0',
'name': 'Beta Educação',
'id': '5OxmMjL-ujoR5IMGegQz',
'id': 'cJtK9SsnJhKPyxESe7g3DG',
'cnpj': '15608435000190',
'create_date': '2025-03-13T16:36:50.073156-03:00',
}