def test_context(self): reporter = lambda x: x environ = {} top = _CTX_STACK.top ctx = RequestContext(reporter, environ) self.assertIsNot(ctx, top) ctx.push() top = _CTX_STACK.top self.assertIs(ctx, top) ctx.pop() top = _CTX_STACK.top self.assertIsNot(ctx, top)
def test_context(self): reporter = lambda x: x environ = {} ctx = RequestContext(reporter, environ) top = LOCAL_STACK.pynba assert top is None assert ctx.pynba is None ctx.push() top = LOCAL_STACK.pynba assert ctx.pynba == top top = LOCAL_STACK.pynba ctx.pop() assert ctx.pynba is None assert ctx.pynba != top