def test_popContext_returnValOk(self): cb = ContextBroker() ctx = object() cb.pushContext(ctx) assert cb.context is ctx assert cb.popContext() is ctx
def test_effectOfPopContextOk(self): cb = ContextBroker() py.test.raises(IndexError, cb.popContext) ctx1 = object() ctx2 = object() cb.pushContext(ctx1) cb.pushContext(ctx2) assert cb.context is ctx2 assert cb.popContext() is ctx2 assert cb.context is ctx1
def test_popEmpty(self): cb = ContextBroker() py.test.raises(IndexError, lambda: cb.popContext())