def test_addHandler(self): """ Test the addition of a protocol handler. """ handler = XMPPHandler() handler.setHandlerParent(self.factory.streamManager) self.assertIn(handler, self.factory.streamManager) self.assertIdentical(self.factory.streamManager, handler.parent)
def test_addHandler(self): """ Test the addition of a protocol handler. """ handler = XMPPHandler() handler.setHandlerParent(self.factory.streamManager) self.assertIn(handler, self.factory.streamManager) self.assertIdentical(self.factory.streamManager, handler.parent)
def test_removeHandler(self): """ Test removal of a protocol handler. """ handler = XMPPHandler() handler.setHandlerParent(self.factory.streamManager) handler.disownHandlerParent(self.factory.streamManager) self.assertNotIn(handler, self.factory.streamManager) self.assertIdentical(None, handler.parent)
def test_removeHandler(self): """ Test removal of a protocol handler. """ handler = XMPPHandler() handler.setHandlerParent(self.factory.streamManager) handler.disownHandlerParent(self.factory.streamManager) self.assertNotIn(handler, self.factory.streamManager) self.assertIdentical(None, handler.parent)