Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PYTHON-4299 Add support for TopologyDescriptionChangedEvent to expectEvents #1572

Merged
merged 2 commits into from
Apr 11, 2024

Conversation

ShaneHarvey
Copy link
Member

@ShaneHarvey ShaneHarvey marked this pull request as ready for review April 5, 2024 22:05
@caseyclements
Copy link
Contributor

@ShaneHarvey Please don't merge this until I've had a chance to look at it and ask questions.

else:
self.test.assertIsNone(actual.server_connection_id)
field = camel_to_snake(field)
self.test.assertEqual(getattr(actual, field), expected)
Copy link
Member Author

@ShaneHarvey ShaneHarvey Apr 10, 2024

Choose a reason for hiding this comment

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

I refactored this code because the old version silently ignored any unknown fields. The new version fails on unknown fields so that we know to add support for them. It also should be easier to maintain since fields that only need to be renamed with camel_to_snake are supported automatically like "minWireVersion", "topologyVersion", "commandName", etc....

Copy link
Contributor

@NoahStapp NoahStapp left a comment

Choose a reason for hiding this comment

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

Great changes!

@ShaneHarvey ShaneHarvey merged commit 4e5813c into mongodb:master Apr 11, 2024
73 of 76 checks passed
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