mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 01:09:40 +08:00
Replace bandit, flake8, isort, and pyupgrade with ruff (#8178)
* Replace bandit, flake8, isort, and pyupgrade with ruff * Comment on ruff rules * updating DIRECTORY.md --------- Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
This commit is contained in:
@ -26,7 +26,6 @@ Reference: https://deadhacker.com/2006/02/21/sha-1-illustrated/
|
||||
import argparse
|
||||
import hashlib # hashlib is only used inside the Test class
|
||||
import struct
|
||||
import unittest
|
||||
|
||||
|
||||
class SHA1Hash:
|
||||
@ -128,14 +127,9 @@ class SHA1Hash:
|
||||
return "%08x%08x%08x%08x%08x" % tuple(self.h)
|
||||
|
||||
|
||||
class SHA1HashTest(unittest.TestCase):
|
||||
"""
|
||||
Test class for the SHA1Hash class. Inherits the TestCase class from unittest
|
||||
"""
|
||||
|
||||
def testMatchHashes(self): # noqa: N802
|
||||
msg = bytes("Test String", "utf-8")
|
||||
self.assertEqual(SHA1Hash(msg).final_hash(), hashlib.sha1(msg).hexdigest())
|
||||
def test_sha1_hash():
|
||||
msg = b"Test String"
|
||||
assert SHA1Hash(msg).final_hash() == hashlib.sha1(msg).hexdigest() # noqa: S324
|
||||
|
||||
|
||||
def main():
|
||||
|
Reference in New Issue
Block a user