def test_amoralRPort(self):
        p = self.clientPort.getHost().port
        r = sip.Request("REGISTER", "sip:bell.example.com")
        r.addHeader("to", "sip:joe@bell.example.com")
        r.addHeader("contact", "sip:joe@127.0.0.1:%d" % p)
        r.addHeader("via", sip.Via("127.0.0.1", port=p, rport=True).toString())
        warnings = self.flushWarnings(
            offendingFunctions=[self.test_amoralRPort])
        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.client.sendMessage(sip.URL(host="127.0.0.1",
                                        port=self.serverAddress[1]),
                                r)
        d = self.client.deferred
        def check(received):
            self.assertEquals(len(received), 1)
            r = received[0]
            self.assertEquals(r.code, 200)
        d.addCallback(check)
        return d
rport is allowed without a value, apparently because server
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/test/test_sip.py/LiveTest.test_amoralRPort