MCPcopy Create free account
hub / github.com/mongodb/mongo-python-driver / test_srv_max_hosts_kwarg

Method test_srv_max_hosts_kwarg

test/test_client.py:1975–1986  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1973 client.close()
1974
1975 def test_srv_max_hosts_kwarg(self):
1976 client = self.simple_client("mongodb+srv://test1.test.build.10gen.cc/")
1977 client._connect()
1978 self.assertGreater(len(client.topology_description.server_descriptions()), 1)
1979 client = self.simple_client("mongodb+srv://test1.test.build.10gen.cc/", srvmaxhosts=1)
1980 client._connect()
1981 self.assertEqual(len(client.topology_description.server_descriptions()), 1)
1982 client = self.simple_client(
1983 "mongodb+srv://test1.test.build.10gen.cc/?srvMaxHosts=1", srvmaxhosts=2
1984 )
1985 client._connect()
1986 self.assertEqual(len(client.topology_description.server_descriptions()), 2)
1987
1988 @unittest.skipIf(
1989 client_context.load_balancer,

Callers

nothing calls this directly

Calls 3

server_descriptionsMethod · 0.80
simple_clientMethod · 0.45
_connectMethod · 0.45

Tested by

no test coverage detected