Skip to content

Conversation

@guanlinzhou
Copy link
Contributor

Add a property for accessing current topology description in MongoClient.

Open Questions:
How to test these changes/run locally?

Copy link
Contributor

@prashantmital prashantmital left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we are adding a public property we also want to add something to test_client.py that would result in a failure if we ever inadvertently removed this property from MongoClient. The simplest( and most naive) approach to testing this would be to add a test to ClientUnitTest that checks that client.topology_description returns the same object as client._topology._description.

Copy link
Member

@ShaneHarvey ShaneHarvey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work. Just one quick ask.

@guanlinzhou guanlinzhou requested a review from ShaneHarvey March 24, 2021 08:18
self.assertFalse(c.secondaries)
c = rs_or_single_client(connect=False)
self.assertIsInstance(c.max_write_batch_size, int)
self.assertIsInstance(c.topology_description, TopologyDescription)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicely done.

@prashantmital prashantmital merged commit 0752280 into mongodb:master Mar 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants