def _hash_comparison(self):
def hash_then_or(hash_name):<EOL><INDENT>return chain([hash_name], repeat('<STR_LIT>'))<EOL><DEDENT>lines = []<EOL>for hash_name, expecteds in iteritems(self.allowed):<EOL><INDENT>prefix = hash_then_or(hash_name)<EOL>lines.extend(('<STR_LIT>' % (next(prefix), e))<EOL>for e in expecteds)<EOL>lines.append('<STR_LIT>' %<EOL>self.gots[hash_name].hexdigest())<EOL>prefix = '<STR_LIT>'<EOL><DEDENT>return '<STR_LIT:\n>'.join(lines)<EOL>
Return a comparison of actual and expected hash values.

Example::

       Expected sha256 abcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcde
                    or 123451234512345123451234512345123451234512345
            Got        bcdefbcdefbcdefbcdefbcdefbcdefbcdefbcdefbcdef