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
|
Description: Skip the tests that require network access
Author: Salvo 'LtWorf' Tomaselli <ltworf@debian.org>
Forwarded: no
Last-Update: 2024-10-14
--- a/test/asynchronous/test_client.py
+++ b/test/asynchronous/test_client.py
@@ -510,6 +510,7 @@
self.assertEqual(clopts.replica_set_name, "newname")
self.assertEqual(clopts.read_preference, ReadPreference.SECONDARY_PREFERRED)
+ @unittest.skip("no connection")
async def test_connection_timeout_ms_propagates_to_DNS_resolver(self):
# Patch the resolver.
from pymongo.asynchronous.srv_resolver import _resolve
--- a/test/test_client.py
+++ b/test/test_client.py
@@ -503,6 +503,7 @@
self.assertEqual(clopts.replica_set_name, "newname")
self.assertEqual(clopts.read_preference, ReadPreference.SECONDARY_PREFERRED)
+ @unittest.skip("no connection")
def test_connection_timeout_ms_propagates_to_DNS_resolver(self):
# Patch the resolver.
from pymongo.synchronous.srv_resolver import _resolve
@@ -622,29 +623,6 @@
logs = [record.getMessage() for record in cm.records if record.name == "pymongo.client"]
self.assertEqual(len(logs), 7)
- @skipIf(os.environ.get("DEBUG_LOG"), "Enabling debug logs breaks this test")
- @patch("pymongo.synchronous.srv_resolver._SrvResolver.get_hosts")
- def test_detected_environment_warning(self, mock_get_hosts):
- with self._caplog.at_level(logging.WARN):
- normal_hosts = [
- "host.cosmos.azure.com",
- "host.docdb.amazonaws.com",
- "host.docdb-elastic.amazonaws.com",
- ]
- srv_hosts = ["mongodb+srv://<test>:<test>@" + s for s in normal_hosts]
- multi_host = (
- "host.cosmos.azure.com,host.docdb.amazonaws.com,host.docdb-elastic.amazonaws.com"
- )
- for host in normal_hosts:
- with self.assertWarns(UserWarning):
- self.simple_client(host)
- for host in srv_hosts:
- mock_get_hosts.return_value = [(host, 1)]
- with self.assertWarns(UserWarning):
- self.simple_client(host)
- with self.assertWarns(UserWarning):
- self.simple_client(multi_host)
-
class TestClient(IntegrationTest):
def test_multiple_uris(self):
|