Repository navigation
Changing query filters from list of tuples to dict - #37
Conversation
Codecov Report
@@ Coverage Diff @@
## master #37 +/- ##
==========================================
+ Coverage 87.38% 88.48% +1.09%
==========================================
Files 19 19
Lines 547 547
==========================================
+ Hits 478 484 +6
+ Misses 69 63 -6
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
|
@martin1tab Thanks for the PR! We're just waiting for #33 to be merged, because it deletes the routing module. So there might be conflicts with your PR. But overall, your proposition looks good! Could you just investigate the low coverage on diff hit please? 🙏 |
| import pytest | ||
|
|
||
| from app.api import crud | ||
| from app.api.deps import get_current_user, get_current_device |
There was a problem hiding this comment.
You may look at the Unit test refactoring in #33 to stay in the same spirit.
There was a problem hiding this comment.
Not done yet:
I agree; but I am struggling a little bit to monkey-patch the users and devices tables in this module (test_deps); but I will take this comment into account in my next PR
|
Hey @martin1tab, |
Yes, I still have this issue; I am still investigating this problem |
|
frgfm
left a comment
There was a problem hiding this comment.
A few things to adapt in the test but the rest looks good to me!
Issue28's description:
While designing new unittests, I figured I wasn't sure about what to expect when we use query_filters with multiple filters on a single value. Since this does not include order relationships but strictly equality, I suggest changing this to a dictionary to prevent duplication of keys.
Here is an example on the fetch_all crud function:
what a call currently looks like
result_entries = crud.fetch_all(user_table, [('username', 'fg')]
my suggestion
result_entries = crud.fetch_all(user_table, {'username': 'fg'}]