Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions test/test_srv_polling.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,24 @@ def test_does_not_flipflop(self):
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()