Skip to content

Conversation

@leorochael
Copy link
Contributor

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

@leorochael leorochael force-pushed the leorochael-get_default_database_default_parameter branch from c18434a to fc9af4c Compare January 19, 2021 13:41
@codecov
Copy link

codecov bot commented Jan 19, 2021

Codecov Report

Merging #693 (fc9af4c) into develop (8caa800) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #693   +/-   ##
========================================
  Coverage    95.37%   95.37%           
========================================
  Files           19       19           
  Lines         3612     3614    +2     
========================================
+ Hits          3445     3447    +2     
  Misses         167      167           
Impacted Files Coverage Δ
mongomock/mongo_client.py 96.22% <100.00%> (+0.07%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8caa800...16377a2. Read the comment docs.

Copy link
Member

@pcorpet pcorpet left a comment

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):
Copy link
Member

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

Copy link
Contributor Author

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 leorochael force-pushed the leorochael-get_default_database_default_parameter branch from 0810ad6 to 16377a2 Compare January 22, 2021 14:14
@leorochael
Copy link
Contributor Author

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()`.
@pcorpet pcorpet force-pushed the leorochael-get_default_database_default_parameter branch from 16377a2 to 64f8f4f Compare June 6, 2021 13:20
@pcorpet pcorpet merged commit 03661bd into mongomock:develop Jun 6, 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.

2 participants