def context_manager(self): """LocalProxy refering to the app's instance of the :class: `ContextManager`. Interface for adding and accessing contexts and their parameters """ return getattr(_app_ctx_stack.top, '_assist_context_manager', ContextManager())
def manager(simple_assist): # give dummy session_id b/c # these tests won't recieve requests # simple_assist.session_id = "test-session-id" m = ContextManager(assist=simple_assist) assert len(m._cache) == 0 assert len(m.active) == 0 return m