Example #1
0
    def inserts_pickable_object_into_session(self):
        driver = RedisDriver(dict(db=0))

        foo = dict(foo='bar')

        driver.set('session-id', foo)

        result = self.client.get('session-id')

        self.assertEqual(pickle.loads(result), foo)
Example #2
0
    def inserts_pickable_object_into_session(self):
        driver = RedisDriver(dict(db=0))

        foo = dict(foo='bar')

        driver.set('session-id', foo)

        result = self.client.get('session-id')

        self.assertEqual(pickle.loads(result), foo)
Example #3
0
    def makes_session_expire_in_one_day_in_the_client(self):
        driver = RedisDriver(dict(db=0))

        foo = dict(foo='bar')

        test_case = self

        class StubClient(object):
            def set(self, session_id, pickled_session):
                pass

            def expire(self, session_id, expiration):
                test_case.assertEqual(expiration, RedisDriver.EXPIRE_SECONDS)

        driver.client = StubClient()

        driver.set('session-id', foo)
Example #4
0
    def makes_session_expire_in_one_day_in_the_client(self):
        driver = RedisDriver(dict(db=0))

        foo = dict(foo='bar')

        test_case = self

        class StubClient(object):
            def set(self, session_id, pickled_session):
                pass

            def expire(self, session_id, expiration):
                test_case.assertEqual(expiration, RedisDriver.EXPIRE_SECONDS)

        driver.client = StubClient()

        driver.set('session-id', foo)