Skip to content

Commit a0e4c7f

Browse files
committed
Apply formatting
Signed-off-by: Philippe Ombredanne <[email protected]>
1 parent b6ace69 commit a0e4c7f

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/commoncode/hash.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import hashlib
1111
import os
1212
import sys
13-
1413
from functools import partial
1514

1615
from commoncode import filetype
@@ -32,6 +31,7 @@ class Hashable:
3231
"""
3332
A mixin for hashers that provides the base methods.
3433
"""
34+
3535
# digest_size = length of binary digest for this hash
3636
# binh = binary hasher module
3737
# msg_len = length in bytes of the messages hashed
@@ -259,7 +259,7 @@ def sha1_git(location):
259259
return checksum(location, name="sha1_git", base64=False)
260260

261261

262-
def binary_chunks(location, size=2 ** 24):
262+
def binary_chunks(location, size=2**24):
263263
"""
264264
Read file at ``location`` as binary and yield bytes of up to ``size`` length in bytes,
265265
defaulting to 2**24 bytes, e.g., about 16 MB.

tests/test_hash.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
# See https://aboutcode.org for more information about nexB OSS projects.
77
#
88

9-
import os
109
import hashlib
10+
import os
1111

1212
from commoncode.hash import b64sha1
1313
from commoncode.hash import checksum
@@ -180,7 +180,9 @@ def test_sha1_git_checksum(self):
180180
def test_checksum_from_chunks_can_stream_gigabytes(self):
181181
chunk_16mb = b"0" * 16000000
182182
chunks_3dot2gb = (chunk_16mb for _ in range(200))
183-
result = checksum_from_chunks(chunks=chunks_3dot2gb, total_length=16000000 * 200, name="sha1_git")
183+
result = checksum_from_chunks(
184+
chunks=chunks_3dot2gb, total_length=16000000 * 200, name="sha1_git"
185+
)
184186
assert result == "494caf26c43c4473f6e930b0f5c2ecf8121bcf24"
185187

186188
def test_checksum_from_chunks_from_stream_is_same_as_plain(self):

0 commit comments

Comments
 (0)