Add default and options to `MongoClient.get_default_database()` by leorochael · Pull Request #693 · mongomock/mongomock
Conversation
Add the default= parameter to MongoClient.get_default_database() to equalize behavior with pymongo.
Forward remaining keyword arguments from MongoClient.get_default_database() to MongoClient.get_database().
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix.
| c.get_default_database() | ||
|
|
||
| def test__getting_default_database_with_default_parameter(self): | ||
| def client(uri): |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to create that here as you ony create one client.
Same below
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. Sorry for the cargo-cult.
I've dropped them and rebased the PR.
I don't know what to make of the one failing test.
I don't think it's related to the changes in this PR.
Add the `default=` parameter to `MongoClient.get_default_database()` to equalize behavior with `pymongo`. Forward remaining keyword arguments from `MongoClient.get_default_database()` to `MongoClient.get_database()`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters