def test_replacesIfTrue(self):
        """
        L{util._replaceIf} swaps out the body of a function if the conditional
        is C{True}.
        """
        @util._replaceIf(True, lambda: "hi")
        def test():
            return "bye"

        self.assertEqual(test(), "hi")
        self.assertEqual(test.__name__, "test")
        self.assertEqual(test.__module__, "twisted.python.test.test_util")

        L{util._replaceIf} swaps out the body of a function if the conditional
        is C{True}.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/python/test/test_util.py