fix session

This commit is contained in:
2025-11-28 16:11:44 -03:00
parent c71e19eacb
commit f684f4021f
4 changed files with 77 additions and 14 deletions

View File

@@ -0,0 +1,31 @@
from http import HTTPMethod
from layercake.dynamodb import DynamoDBPersistenceLayer, PartitionKey
from ..conftest import HttpApiProxy, LambdaContext
def test_authentication(
app,
seeds,
dynamodb_persistence_layer: DynamoDBPersistenceLayer,
http_api_proxy: HttpApiProxy,
lambda_context: LambdaContext,
):
r = app.lambda_handler(
http_api_proxy(
raw_path='/authentication',
method=HTTPMethod.POST,
body={
'username': '07879819908',
'password': 'pytest@123',
},
),
lambda_context,
)
assert len(r['cookies']) == 1
session = dynamodb_persistence_layer.collection.query(PartitionKey('SESSION'))
# One seesion if created from seeds
assert len(session['items']) == 2