Skip to content

Commit

Permalink
testers
Browse files Browse the repository at this point in the history
  • Loading branch information
idocyabra committed Apr 15, 2024
1 parent ebfcf87 commit e923ea7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/test_dynamodb.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import json
from contextlib import contextmanager
from datetime import timedelta

import boto3
import flask
import pytest
from flask_session.defaults import Defaults
from flask_session.dynamodb import DynamoDBSession

from tests.utils import session_permanent, session_refresh_each_request

from tests.abs_test import ABSTestSession
Expand Down Expand Up @@ -45,7 +48,8 @@ def setup_dynamodb(self):
)

def retrieve_stored_session(self, key, app):
return dict(self.store.get_item(Key={"id": key}).get("Item"))
document = self.store.get_item(Key={"id": key}).get("Item")
return json.loads(bytes(document["val"]).decode("utf-8")) if bytes(document["val"]) else {}

def test_dynamodb_default(self, app_utils):
with self.setup_dynamodb():
Expand Down Expand Up @@ -85,7 +89,9 @@ def test_default(self, app_utils, _session_permanent,
def test_lifetime(self, app_utils,
_session_permanent,
_session_refresh_each_request):
pytest.skip("TTL index issue")
with self.setup_dynamodb():

app = app_utils.create_app(
{
"SESSION_TYPE": "dynamodb",
Expand Down

0 comments on commit e923ea7

Please sign in to comment.