add session route
This commit is contained in:
30
id.saladeaula.digital/tests/routes/test_session.py
Normal file
30
id.saladeaula.digital/tests/routes/test_session.py
Normal file
@@ -0,0 +1,30 @@
|
||||
from http import HTTPMethod
|
||||
|
||||
from layercake.dynamodb import DynamoDBPersistenceLayer, PartitionKey
|
||||
|
||||
from ..conftest import HttpApiProxy, LambdaContext
|
||||
|
||||
|
||||
def test_session(
|
||||
app,
|
||||
seeds,
|
||||
dynamodb_persistence_layer: DynamoDBPersistenceLayer,
|
||||
http_api_proxy: HttpApiProxy,
|
||||
lambda_context: LambdaContext,
|
||||
):
|
||||
r = app.lambda_handler(
|
||||
http_api_proxy(
|
||||
raw_path='/session',
|
||||
method=HTTPMethod.POST,
|
||||
body={
|
||||
'username': '07879819908',
|
||||
'password': 'pytest@123',
|
||||
},
|
||||
),
|
||||
lambda_context,
|
||||
)
|
||||
|
||||
assert len(r['cookies']) == 1
|
||||
|
||||
session = dynamodb_persistence_layer.collection.query(PartitionKey('SESSION'))
|
||||
assert len(session['items']) == 1
|
||||
Reference in New Issue
Block a user