

def test_expire_sessions(self):
    sessions = [SessionFake() for i in range(10)]
    for (index, s) in enumerate(sessions):
        s.session_id = index
        s.expiry = index
        s.expiry_date = index
        self.sc.add(s)
    now = 5
    self.sc.expire(current_time=now)
    for s in sessions:
        if (s.expiry_date > now):
            self.assertTrue(self._check_session_is_in_items(session=s))
            self.assertTrue(self._check_session_is_in_queue(session=s))
        else:
            self.assertFalse(self._check_session_is_in_items(session=s))
            self.assertFalse(self._check_session_is_in_queue(session=s))

dataset/ETHPy150Open flaviogrossi/sockjs-cyclone/tests/test_sessioncontainer.py SessionContainerTest.test_expire_sessions/original