-
Notifications
You must be signed in to change notification settings - Fork 4
Increase pwcrypto unit test coverage #343
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
Increase pwcrypto unit test coverage #343
Conversation
The unit tests failing here |
7a5fb13
to
d4dbb39
Compare
Marked follow-up to cover remaining polish of a few minor corner cases at outlined in TODO comments in the code. Still, better to get wide coverage in to support the related #347 and polish last bits later. |
…unit test leftovers.
simple hash, hash and digest. Mixes in various policy configurations.
* make_safe_hash (sha256) * valid_login_password * make_scramble+check_scramble * make_encrypt+make_decrypt for fernet, aesgcm and aesgcm_static * make_encrypt output variation for fernet, aesgcm and aesgcm_static * make_encrypt+check_encrypt for fernet, aesgcm and aesgcm_static * generate/parse/verify_reset_token
…. The conversion is already explicitly handled in all `make_encrypt` backends where it's needed and the bytes break the initial `assure_password_strength` call. Including the fix here as only the new unit test triggers it.
* clarify that make_hash generates value depending on random seed * assure check_hash works despite this variation in hashes depending on seed * make sure otherwise valid password reset tokens fail when expired
78c1429
to
22b25d9
Compare
Better to get improved coverage as you say. Other suggestions can wait :) |
Rereading your original reply I noticed that I missed one important point 👍 because I got caught up in the first bit about the basic test of make_hash itself being removed, which was not in fact the case 8-D I do generally agree that it makes sense to test dependent functions on static output of their dependecy functions (like from make_hash in this example) to differentiate and pinpoint where if/when errors creep in. In many cases it just also has value to test the combination IMO, so I'd rather that we aim for both. |
Add more test coverage and clean up some copy/pasted pickle unit test leftovers.
NB: changes one single line of (currently unused) actual code as explained in
d4dbb39
despite the test-only tag.