-
Notifications
You must be signed in to change notification settings - Fork 135
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
[issue-722] add calculate_package_verification_code()
#723
[issue-722] add calculate_package_verification_code()
#723
Conversation
It seems that Windows yields different results when using Edit: This was due to |
ca98d6c
to
be46a07
Compare
|
||
with pytest.raises(FileNotFoundError) as err: | ||
calculate_package_verification_code([file1]) | ||
assert unknown_file_name in err.value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is never reached, you need to unindent it one level.
You also have to explicitly convert the error to string, otherwise this assertion fails, i.e. str(err.value)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! :)
|
||
def calculate_package_verification_code(files: List[File]) -> str: | ||
list_of_file_hashes = [] | ||
hash_algorithm_name = ChecksumAlgorithm.SHA1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be a parameter to the function and then consequently used below wherever SHA1 is explicitly mentioned? Or is there a reason we only want to support SHA1 here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
also add calculate_file_checksum(), as this is needed by the package verification code Signed-off-by: Armin Tänzer <armin.taenzer@tngtech.com>
be46a07
to
f9efcac
Compare
also add
calculate_file_checksum()
, as this is needed by the package verification codefixes #722