File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -1074,6 +1074,13 @@ async def test_uri_connect_option(self):
1074
1074
kc_task = client ._kill_cursors_executor ._task
1075
1075
self .assertTrue (kc_task and not kc_task .done ())
1076
1076
1077
+ async def test_close_does_not_open_servers (self ):
1078
+ client = await self .async_rs_client (connect = False )
1079
+ topology = client ._topology
1080
+ self .assertEqual (topology ._servers , {})
1081
+ await client .close ()
1082
+ self .assertEqual (topology ._servers , {})
1083
+
1077
1084
async def test_close_closes_sockets (self ):
1078
1085
client = await self .async_rs_client ()
1079
1086
await client .test .test .find_one ()
@@ -1891,7 +1898,7 @@ async def test_service_name_from_kwargs(self):
1891
1898
client = AsyncMongoClient (
1892
1899
"mongodb+srv://user:[email protected] " ,
1893
1900
srvServiceName = "customname" ,
1894
- connect = False ,
1901
+ connect = True ,
1895
1902
)
1896
1903
await client .aconnect ()
1897
1904
self .assertEqual (client ._topology_settings .srv_service_name , "customname" )
Original file line number Diff line number Diff line change @@ -1047,6 +1047,13 @@ def test_uri_connect_option(self):
1047
1047
kc_task = client ._kill_cursors_executor ._task
1048
1048
self .assertTrue (kc_task and not kc_task .done ())
1049
1049
1050
+ def test_close_does_not_open_servers (self ):
1051
+ client = self .rs_client (connect = False )
1052
+ topology = client ._topology
1053
+ self .assertEqual (topology ._servers , {})
1054
+ client .close ()
1055
+ self .assertEqual (topology ._servers , {})
1056
+
1050
1057
def test_close_closes_sockets (self ):
1051
1058
client = self .rs_client ()
1052
1059
client .test .test .find_one ()
@@ -1848,7 +1855,7 @@ def test_service_name_from_kwargs(self):
1848
1855
client = MongoClient (
1849
1856
"mongodb+srv://user:[email protected] " ,
1850
1857
srvServiceName = "customname" ,
1851
- connect = False ,
1858
+ connect = True ,
1852
1859
)
1853
1860
client ._connect ()
1854
1861
self .assertEqual (client ._topology_settings .srv_service_name , "customname" )
You can’t perform that action at this time.
0 commit comments