def test_deprecatedRPort(self):
        """
        Setting rport to True is deprecated, but still produces a Via header
        with the expected properties.
        """
        v = sip.Via("foo.bar", rport=True)

        warnings = self.flushWarnings(
            offendingFunctions=[self.test_deprecatedRPort])
        self.assertEqual(len(warnings), 1)
        self.assertEqual(
            warnings[0]['message'],
            'rport=True is deprecated since Twisted 9.0.')
        self.assertEqual(
            warnings[0]['category'],
            DeprecationWarning)

        self.assertEqual(v.toString(), "SIP/2.0/UDP foo.bar:5060;rport")
        self.assertTrue(v.rport)
        self.assertTrue(v.rportRequested)
        self.assertIsNone(v.rportValue)

        Setting rport to True is deprecated, but still produces a Via header
        with the expected properties.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_sip.py