コード例 #1
0
    def test_construct(self):
        gatherer = RTCIceGatherer()
        connection = RTCIceTransport(gatherer)
        self.assertEqual(connection.state, 'new')
        self.assertEqual(connection.getRemoteCandidates(), [])

        candidate = RTCIceCandidate(component=1,
                                    foundation='0',
                                    ip='192.168.99.7',
                                    port=33543,
                                    priority=2122252543,
                                    protocol='UDP',
                                    type='host')

        # add candidate
        connection.addRemoteCandidate(candidate)
        self.assertEqual(connection.getRemoteCandidates(), [candidate])

        # end-of-candidates
        connection.addRemoteCandidate(None)
        self.assertEqual(connection.getRemoteCandidates(), [candidate])
コード例 #2
0
    def test_construct(self):
        gatherer = RTCIceGatherer()
        connection = RTCIceTransport(gatherer)
        self.assertEqual(connection.state, "new")
        self.assertEqual(connection.getRemoteCandidates(), [])

        candidate = RTCIceCandidate(
            component=1,
            foundation="0",
            ip="192.168.99.7",
            port=33543,
            priority=2122252543,
            protocol="UDP",
            type="host",
        )

        # add candidate
        run(connection.addRemoteCandidate(candidate))
        self.assertEqual(connection.getRemoteCandidates(), [candidate])

        # end-of-candidates
        run(connection.addRemoteCandidate(None))
        self.assertEqual(connection.getRemoteCandidates(), [candidate])