コード例 #1
0
 def test_should_refresh_if_supported_and_necessary(self):
     session = _Session(
         flask_session={'last_authenticated': time.time() - 11
                        },  # authenticated too far in the past
         session_refresh_interval_seconds=10)
     assert session.should_refresh()
コード例 #2
0
 def test_should_not_refresh_if_authenticated_within_refresh_interval(self):
     session = _Session(
         flask_session={'last_authenticated': time.time() + 5},
         session_refresh_interval_seconds=10)
     assert not session.should_refresh()
コード例 #3
0
 def test_authenticated_session(self):
     session = _Session(flask_session={'last_authenticated': 1234},
                        session_refresh_interval_seconds=None)
     assert session.is_authenticated()
コード例 #4
0
 def test_should_not_refresh_if_not_supported(self):
     session = _Session(flask_session={},
                        session_refresh_interval_seconds=None)
     assert not session.should_refresh()
コード例 #5
0
 def test_unauthenticated_session(self):
     session = _Session(flask_session={},
                        session_refresh_interval_seconds=None)
     assert not session.is_authenticated()