-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lnd.py: add tests for and refactor create_wallet() #31
Conversation
Generally accepted best practice is to store "magic numbers" and the like as constants, which allows us to avoid repetition and errors, and will make testing easier at a later stage (since we can reference module.CONSTANT_NAME in unit tests)
Looks good but need someone to make sure it all works for the two scenarios at least.
|
I’ll write tests before merging. Thank you for your contribution! |
I'm working on tests as well... |
key thing is the last test which I haven't got working right
Added some preliminary tests: |
Good job with the tests! That create wallet function was just originally a hack job from its humble beginnings. Glad to see theres some testing coverage in it. |
I cannot find any way for this block of code to do anything.
Finished tests for create_wallet(), everything should work... now to start refactoring |
this seems to be an issue with the order of imports, the tests appear to no longer be correctly mocking requests.get() and requests.post()
see previous commit message for hypothesis (issue is the same)
Refactor done |
(This PR still has not been tested on a running system) |
Now that there's a simple standalone neutrino mode, we can test more easily |
Excellent work @ln2max! Logic works flawlessly and code quality is greatly improved. I have confirmed that keys get created and restored |
Fix line lengths to pep8-compliant 79 chars, and break out constants from create_wallet() ahead of writing tests. This will make testing easier at a later stage (since we can reference module.CONSTANT_NAME in unit tests)
Please test this PR before merging, I have not got
noma
set up locally yet for "live" testing!