Exemplo n.º 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])
Exemplo n.º 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])
Exemplo n.º 3
0
 def test_default_ice_servers(self):
     self.assertEqual(
         RTCIceGatherer.getDefaultIceServers(),
         [RTCIceServer(urls="stun:stun.l.google.com:19302")],
     )
Exemplo n.º 4
0
 def test_construct(self):
     gatherer = RTCIceGatherer()
     self.assertEqual(gatherer.state, 'new')
     self.assertEqual(gatherer.getLocalCandidates(), [])
     run(gatherer.gather())
     self.assertTrue(len(gatherer.getLocalCandidates()) > 0)