def test_lookupFunctionDeprecatedOverride(self):
        """
        Subclasses which override locateResponder under its old name,
        lookupFunction, should have the override invoked instead.  (This tests
        an AMP subclass, because in the version of the code that could invoke
        this deprecated code path, there was no L{CommandLocator}.)
        """
        locator = OverrideLocatorAMP()
        customResponderObject = self.assertWarns(
            PendingDeprecationWarning,
            "Override locateResponder, not lookupFunction.",
            __file__, lambda : locator.locateResponder(b"custom"))
        self.assertEqual(locator.customResponder, customResponderObject)
        # Make sure upcalling works too
        normalResponderObject = self.assertWarns(
            PendingDeprecationWarning,
            "Override locateResponder, not lookupFunction.",
            __file__, lambda : locator.locateResponder(b"simple"))
        result = normalResponderObject(amp.Box(greeting=b"ni hao", cookie=b"5"))
        def done(values):
            self.assertEqual(values, amp.AmpBox(cookieplus=b'8'))
        return result.addCallback(done)

        Subclasses which override locateResponder under its old name,
        lookupFunction, should have the override invoked instead.  (This tests
        an AMP subclass, because in the version of the code that could invoke
        this deprecated code path, there was no L{CommandLocator}.)
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_amp.py