(self)
| 1947 | coll.insert_many([{} for _ in range(5)]) |
| 1948 | |
| 1949 | def test_service_name_from_kwargs(self): |
| 1950 | client = MongoClient( |
| 1951 | "mongodb+srv://user:password@test22.test.build.10gen.cc", |
| 1952 | srvServiceName="customname", |
| 1953 | connect=False, |
| 1954 | ) |
| 1955 | client._connect() |
| 1956 | self.assertEqual(client._topology_settings.srv_service_name, "customname") |
| 1957 | client.close() |
| 1958 | client = MongoClient( |
| 1959 | "mongodb+srv://user:password@test22.test.build.10gen.cc" |
| 1960 | "/?srvServiceName=shouldbeoverriden", |
| 1961 | srvServiceName="customname", |
| 1962 | connect=False, |
| 1963 | ) |
| 1964 | client._connect() |
| 1965 | self.assertEqual(client._topology_settings.srv_service_name, "customname") |
| 1966 | client.close() |
| 1967 | client = MongoClient( |
| 1968 | "mongodb+srv://user:password@test22.test.build.10gen.cc/?srvServiceName=customname", |
| 1969 | connect=False, |
| 1970 | ) |
| 1971 | client._connect() |
| 1972 | self.assertEqual(client._topology_settings.srv_service_name, "customname") |
| 1973 | client.close() |
| 1974 | |
| 1975 | def test_srv_max_hosts_kwarg(self): |
| 1976 | client = self.simple_client("mongodb+srv://test1.test.build.10gen.cc/") |
nothing calls this directly
no test coverage detected