@@ -156,7 +156,7 @@ def test_explicit_database_param_overrides_uri_default(self):
156156 # Test that explicit database parameter overrides URI default
157157 if TEST_URI :
158158 # Construct a URI with an explicit database path
159- conn = Connection (host = f"{ TEST_URI . rstrip ( '/' ) } /uri_db " , database = "explicit_db" )
159+ conn = Connection (host = f"{ TEST_URI } " , database = "explicit_db" )
160160 else :
161161 conn = Connection (host = "mongodb://localhost:27017/uri_db" , database = "explicit_db" )
162162 assert conn .database is not None
@@ -166,7 +166,7 @@ def test_explicit_database_param_overrides_uri_default(self):
166166 def test_no_database_param_uses_client_default_database (self ):
167167 """When no explicit database parameter is passed, use client's default from URI if present"""
168168 if TEST_URI :
169- conn = Connection (host = f"{ TEST_URI . rstrip ( '/' ) } /test_db " )
169+ conn = Connection (host = f"{ TEST_URI } " )
170170 else :
171171 conn = Connection (host = "mongodb://localhost:27017/test_db" )
172172 assert conn .database is not None
@@ -177,7 +177,7 @@ def test_connection_string_with_mode_query_param(self):
177177 """Test that connection string with ?mode parameter is parsed correctly"""
178178 if TEST_URI :
179179 # Test with mode parameter in query string
180- test_url = f"{ TEST_URI .rstrip ('/ ' )} /test_db? mode=superset"
180+ test_url = f"{ TEST_URI .rstrip ('& ' )} & mode=superset"
181181 else :
182182 test_url = "mongodb://localhost:27017/test_db?mode=superset"
183183
0 commit comments