1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
|
Description: skip network tests unless env var EXTENDED_TESTING is set
Author: Jonas Smedegaard <dr@jones.dk>
Last-Update: 2021-04-13
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/tests/test_ortc.py
+++ b/tests/test_ortc.py
@@ -1,5 +1,6 @@
import asyncio
-from unittest import TestCase
+import os
+from unittest import TestCase, skipUnless
from aiortc import (
RTCCertificate,
@@ -54,6 +55,7 @@
return sctp_a, sctp_b
+@skipUnless('EXTENDED_TESTING' in os.environ, 'test requires network access')
class OrtcTest(TestCase):
@asynctest
async def test_sctp(self):
--- a/tests/test_rtcpeerconnection.py
+++ b/tests/test_rtcpeerconnection.py
@@ -1,6 +1,7 @@
import asyncio
+import os
import re
-from unittest import TestCase
+from unittest import TestCase, skipUnless
import aioice.ice
import aioice.stun
@@ -500,6 +501,7 @@
)
+@skipUnless('EXTENDED_TESTING' in os.environ, 'test requires network access')
class RTCPeerConnectionTest(TestCase):
def assertBundled(self, pc):
transceivers = pc.getTransceivers()
--- a/tests/test_rtcicetransport.py
+++ b/tests/test_rtcicetransport.py
@@ -1,5 +1,6 @@
import asyncio
-from unittest import TestCase
+import os
+from unittest import TestCase, skipUnless
import aioice.stun
from aioice import ConnectionClosed
@@ -241,6 +242,7 @@
class RTCIceGathererTest(TestCase):
+ @skipUnless('EXTENDED_TESTING' in os.environ, 'test requires network access')
@asynctest
async def test_gather(self):
gatherer = RTCIceGatherer()
@@ -300,6 +302,7 @@
await connection.addRemoteCandidate(None)
self.assertEqual(connection.getRemoteCandidates(), [candidate])
+ @skipUnless('EXTENDED_TESTING' in os.environ, 'test requires network access')
@asynctest
async def test_connect(self):
gatherer_1 = RTCIceGatherer()
@@ -330,6 +333,7 @@
self.assertEqual(transport_1.state, "closed")
self.assertEqual(transport_2.state, "closed")
+ @skipUnless('EXTENDED_TESTING' in os.environ, 'test requires network access')
@asynctest
async def test_connect_fail(self):
gatherer_1 = RTCIceGatherer()
|