Legrandin / pycryptodome

A self-contained cryptographic library for Python
https://www.pycryptodome.org
Other
2.74k stars 492 forks source link

Expand unit tests for TupleHash.update() #768

Closed jelaiw closed 9 months ago

jelaiw commented 9 months ago

While documenting issue #767, I noticed a typo (ValueError was ValueErorr) in TupleHash.update(). After fixing typo, I realized that this was dead code (not reachable by calling update(None); likely left over from an earlier version of this function as the existing unit test for update(None) expects TypeError not ValueError.

So, removed the if data is None precondition check for update() and confirmed unit tests pass.

Also, while I was here, expanded the unit tests to test the happy path for the newly supported ways to pass multiple byte strings as well as a regression test in test_update_negative() to catch that update(tuple) raises the expected exception.

Legrandin commented 9 months ago

Merged, thanks