Cover 100% src/krux/key.py
What is this PR for?
-
Add a verbose message when an invalid policy type is used to create a bip39 key in get_default_descriptor static method;
-
add a fallback import case from urandom to random on tests/test_key.py/
-
add a raise exception case of an invalid policy type on tests/test_key.py.
Changes made to:
- [ ] Code
- [x] Tests
- [ ] Docs
- [ ] CHANGELOG
What is the purpose of this pull request?
- [ ] Bug fix
- [ ] New feature
- [ ] Docs update
- [x] Other: cover 100%
src/krux/key.py.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 95.38%. Comparing base (
d14a2ac) to head (a2e30d1). Report is 1 commits behind head on develop.
Additional details and impacted files
@@ Coverage Diff @@
## develop #573 +/- ##
===========================================
+ Coverage 95.37% 95.38% +0.01%
===========================================
Files 76 76
Lines 8607 8607
===========================================
+ Hits 8209 8210 +1
+ Misses 398 397 -1
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
I've been thinking, for the sake of simplicity and standardization, we could remove the try/except with random, just use urandom, and remove the specific test too. This align with other cases like uhashlib, were we use the standard micropython lib, and mock it with respective complete implementations on tests, simulator and Android.
I've been thinking, for the sake of simplicity and standardization, we could remove the try/except with
random, just useurandom, and remove the specific test too. This align with other cases likeuhashlib, were we use the standard micropython lib, and mock it with respective complete implementations on tests, simulator and Android.
Agreed, this resolves an unecessary test, some lint and less code to maintain
I've been thinking, for the sake of simplicity and standardization, we could remove the try/except with
random, just useurandom, and remove the specific test too. This align with other cases likeuhashlib, were we use the standard micropython lib, and mock it with respective complete implementations on tests, simulator and Android.
fixed
fixed
Did you test the simulator? I believe a mock for urandom which loads random will be needed
Just noticed @tadeubas did the needed changes in #588.
Thank you!
fixed
Did you test the simulator? I believe a mock for
urandomwhich loadsrandomwill be needed
Yes, made in simulator before #588