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 77 78 79 80 81 82 83 84 85 86
|
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,
@@ -58,6 +59,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) -> None:
--- a/tests/test_rtcpeerconnection.py
+++ b/tests/test_rtcpeerconnection.py
@@ -1,8 +1,9 @@
import asyncio
import re
from collections.abc import Callable
+import os
from typing import Optional, Union
-from unittest import TestCase
+from unittest import TestCase, skipUnless
import aioice.stun
from aiortc import (
@@ -502,6 +503,7 @@
)
+@skipUnless('EXTENDED_TESTING' in os.environ, 'test requires network access')
class RTCPeerConnectionTest(TestCase):
def assertBundled(self, pc: RTCPeerConnection) -> None:
transceivers = pc.getTransceivers()
--- a/tests/test_rtcicetransport.py
+++ b/tests/test_rtcicetransport.py
@@ -1,5 +1,7 @@
import asyncio
+import os
from typing import Optional
+from unittest import skipUnless
import aioice.ice
import aioice.stun
@@ -240,6 +242,7 @@
class RTCIceGathererTest(TestCase):
+ @skipUnless('EXTENDED_TESTING' in os.environ, 'test requires network access')
@asynctest
async def test_gather(self) -> None:
gatherer = RTCIceGatherer()
@@ -305,6 +308,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) -> None:
gatherer_1 = RTCIceGatherer()
@@ -335,6 +339,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) -> None:
gatherer_1 = RTCIceGatherer()
@@ -363,6 +368,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_then_consent_expires(self) -> None:
gatherer_1 = RTCIceGatherer()
|