Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@mgalka
Copy link
Contributor

@mgalka mgalka commented Jan 16, 2020

When skip was greater than count for
collection.Collection.document_count() the method kept returning
negative values It returns 0 now, which is the expected behaviour.

Fixes Issue #585

@codecov
Copy link

codecov bot commented Jan 16, 2020

Codecov Report

Merging #586 into develop will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #586      +/-   ##
===========================================
- Coverage    94.75%   94.75%   -0.01%     
===========================================
  Files           16       16              
  Lines         3144     3143       -1     
===========================================
- Hits          2979     2978       -1     
  Misses         165      165
Impacted Files Coverage Δ
mongomock/collection.py 91.81% <100%> (-0.01%) ⬇️

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 89b3be8...52fc9a7. 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 your change, please add a test in test__mongomock so we do not have regressions in the future.

When skip was greater than count for
collection.Collection.document_count() the method kept returning
negative values It returns 0 now, which is the expected behaviour.

Signed-off-by: Michal Galka <[email protected]>
@mgalka mgalka force-pushed the issue-585-fix-count_documents branch from ac152c6 to 52fc9a7 Compare January 16, 2020 14:58
@mgalka
Copy link
Contributor Author

mgalka commented Jan 16, 2020

Thanks for your change, please add a test in test__mongomock so we do not have regressions in the future.

I added the tests.

@pcorpet
Copy link
Member

pcorpet commented Jan 16, 2020

Thanks for the quick turnaround on that issue.

@pcorpet pcorpet merged commit 84ca229 into mongomock:develop Jan 16, 2020
@mgalka mgalka deleted the issue-585-fix-count_documents branch January 16, 2020 16:20
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