Open
Conversation
Contributor
matthew-brett
left a comment
There was a problem hiding this comment.
Good - but - check your last function - see comments.
Comment on lines
+35
to
+36
| hash_value = sha1(contents).hexdigest() | ||
| return hash_value |
Contributor
There was a problem hiding this comment.
Or:
Suggested change
| hash_value = sha1(contents).hexdigest() | |
| return hash_value | |
| return sha1(contents).hexdigest() |
| # For each line: | ||
| for line in lst_of_splitted_lines: | ||
| # Split each line into expected_hash and filename | ||
| [exp_hash, gap, filename] = line.split(sep=' ') |
Contributor
There was a problem hiding this comment.
Yes - but you don't even need the brackets around the list on the left hand side. And you can use the default separator (of any number of spaces) to make it a bit simpler, as in:
Suggested change
| [exp_hash, gap, filename] = line.split(sep=' ') | |
| exp_hash, filename = line.split() |
Comment on lines
-57
to
+66
| return False | ||
| result = (act_hash == exp_hash) |
Contributor
There was a problem hiding this comment.
The problem is that you end up returning the result of the last test here, so if any of the previous tests failed, the function still returns True. I think you want something like:
result = result and (act_hash == exp_hash)
to combine the results of the tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Trying to create a pull request.