def test_decoratedProxyMethod(self):
        """
        Methods of the class created from L{proxyForInterface} can be used with
        the decorator-helper L{functools.wraps}.
        """
        base = proxyForInterface(IProxiedInterface)
        class klass(base):
            @wraps(base.yay)
            def yay(self):
                self.original.yays += 1
                return base.yay(self)

        original = Yayable()
        yayable = klass(original)
        yayable.yay()
        self.assertEqual(2, original.yays)

        Methods of the class created from L{proxyForInterface} can be used with
        the decorator-helper L{functools.wraps}.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/python/test/test_components.py