def test_get(self):
        store = RedisSessionStore(
            pretend.stub(
                get=lambda key: b"\x81\xa9user.csrf\xa3wat",
            )
        )
        store.refresh = pretend.call_recorder(lambda session: None)

        session = store.get("EUmoN-Hsp0CFMcULe2KD5c3LjB_otLG-aXZueTkY3DM")

        assert store.refresh.calls == [pretend.call(session)]
        assert not session.new
        assert session == {"user.csrf": "wat"}
        assert session.sid == "EUmoN-Hsp0CFMcULe2KD5c3LjB_otLG-aXZueTkY3DM"
 def test_get_invalid_data_in_redis(self):
     store = RedisSessionStore(pretend.stub(get=lambda key: b"asdsa"))
     assert store.get("EUmoN-Hsp0CFMcULe2KD5c3LjB_otLG-aXZueTkY3DM").new
 def test_get_invalid_session(self):
     store = RedisSessionStore(pretend.stub())
     assert store.get("invalid key").new