PYTHON-2948 Add prose test for SRV polling with a custom service name (#764)
This commit is contained in:
parent
bfa5aafb34
commit
ca46cb20bd
@ -289,6 +289,24 @@ class TestSrvPolling(unittest.TestCase):
|
||||
new = set(client.topology_description.server_descriptions())
|
||||
self.assertSetEqual(old, new)
|
||||
|
||||
def test_srv_service_name(self):
|
||||
# Construct a valid final response callback distinct from base.
|
||||
response = [
|
||||
("localhost.test.build.10gen.cc.", 27019),
|
||||
("localhost.test.build.10gen.cc.", 27020)
|
||||
]
|
||||
|
||||
def nodelist_callback():
|
||||
return response
|
||||
|
||||
with SrvPollingKnobs(
|
||||
ttl_time=WAIT_TIME, min_srv_rescan_interval=WAIT_TIME):
|
||||
client = MongoClient(
|
||||
"mongodb+srv://test22.test.build.10gen.cc/?srvServiceName"
|
||||
"=customname")
|
||||
with SrvPollingKnobs(nodelist_callback=nodelist_callback):
|
||||
self.assert_nodelist_change(response, client)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user