Moved digests to own module.
Refactored related code.
Details
- Reviewers
sengels kfunk - Commits
- R138:f8ec8a14cec6: Added support for sha2 checksums.
Diff Detail
- Repository
- R138 Craft
- Branch
- master
- Lint
No Linters Available - Unit
No Unit Test Coverage
- Fix typos and remove alwaysTrue()
- Revert merge artifact
- Revert "Fix typos and remove alwaysTrue()"
- Cleanup
- Improve digestFile performane
General: Please try to find a single style for spaces and parentheses: either no spaces, or spaces after/before parentheses. Please don't mix, especially not in a single line...
- Is it possible to have unittests when e.g. EmergeDebug.py and EmergeHash.py are run directly? Since you add EmergeHash here, could you write some lines that test e.g. that algorithms are found correctly, that empty files (or some specially generated temporary files) do have a reproduceable hash?
bin/EmergeHash.py | ||
---|---|---|
100 | I am not sure, in theory it would be cool to get the correct indent of the file as well (or the default indent of 2*4 spaces) so that copying that line and entering it inside the package file is easiest... |
bin/EmergeHash.py | ||
---|---|---|
100 | You still have to copy it to the destination. |
I added a basic unit test for the hashes.
What test would you like too?
From sting "[SHA26]...."?
From file name?
For the whitespace, could we add a astyle script or something like that?
bin/EmergeHash.py | ||
---|---|---|
109 | Can't you move that to an extra file and use proper testing infrastructure (Python's unittest lib) for it? We already have bin/test/, would be a good idea to store the new test_EmergeHash.py there. And also make sure it runs with that runtests.py runner. |
- Fix typos and remove alwaysTrue()
- Revert merge artifact
- Revert "Fix typos and remove alwaysTrue()"
- Cleanup
- Improve digestFile performane
- Fix unittest and add unittest for EmergeHash
Diff contains lot of unrelated changes again.
My issue with tests was fixed, so +1 from my side. I'll let Patrick review the digest feature itself :)
Hm, it would be cool if you could split this into several requests next time...
bin/EmergeHash.py | ||
---|---|---|
38 | Shouldn't the default be MD5 or whatever we currently have? |
bin/EmergeHash.py | ||
---|---|---|
38 | I marked it as deprecated and it shouldn't be used at all. |