Add default and options to `MongoClient.get_default_database()` by leorochael · Pull Request #693 · mongomock/mongomock

Conversation

@leorochael

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().

@codecov

pcorpet

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.

@leorochael

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()`.

2 participants

@leorochael @pcorpet