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