diff --git a/PKG-INFO b/PKG-INFO index 6e8954fba81597e0d25a5d295a5c9c5ee38b0381..228fd8d19b4b22fb888d0e059623208792d0e144 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 1.0 Name: swh.model -Version: 0.0.14 +Version: 0.0.15 Summary: Software Heritage data model Home-page: https://forge.softwareheritage.org/diffusion/DMOD/ Author: Software Heritage developers diff --git a/debian/changelog b/debian/changelog index f0b33fd4b0aabc7d3910f5a6878d5ab9b8e8315f..2ef6b9eb808090d5b6c0dd602046aae4dc711910 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,5 @@ swh-model (0.0.1-1) unstable; urgency=low - * Create swh-model package + * Create swh-model package -- Nicolas Dandrimont <olasd@debian.org> Mon, 07 Dec 2015 15:41:28 +0100 diff --git a/debian/control b/debian/control index c20e5f56ce0064a90fd9c8eec7071eca19e028c0..3e7fc44efb63e204152845e0ff6f697268c39e0c 100644 --- a/debian/control +++ b/debian/control @@ -7,6 +7,7 @@ Build-Depends: debhelper (>= 9), python3-all, python3-nose, python3-setuptools, + python3-pyblake2, python3-vcversioner Standards-Version: 3.9.6 Homepage: https://forge.softwareheritage.org/diffusion/DMOD/ diff --git a/requirements-swh.txt b/requirements-swh.txt index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..fbe63bd90787cff4ad7e1a774a2cbffa4a20b17f 100644 --- a/requirements-swh.txt +++ b/requirements-swh.txt @@ -0,0 +1 @@ +pyblake2 diff --git a/swh.model.egg-info/PKG-INFO b/swh.model.egg-info/PKG-INFO index 6e8954fba81597e0d25a5d295a5c9c5ee38b0381..228fd8d19b4b22fb888d0e059623208792d0e144 100644 --- a/swh.model.egg-info/PKG-INFO +++ b/swh.model.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 1.0 Name: swh.model -Version: 0.0.14 +Version: 0.0.15 Summary: Software Heritage data model Home-page: https://forge.softwareheritage.org/diffusion/DMOD/ Author: Software Heritage developers diff --git a/swh.model.egg-info/requires.txt b/swh.model.egg-info/requires.txt index 39a323addb39c408716b8874ef828acd3c4da427..77d4685af0f9d86eb3a67063879b0442b684a389 100644 --- a/swh.model.egg-info/requires.txt +++ b/swh.model.egg-info/requires.txt @@ -1 +1,2 @@ +pyblake2 vcversioner diff --git a/swh/model/hashutil.py b/swh/model/hashutil.py index ea28414fe05bfb1fd0a172f281d9a8de6a23fb08..f9aca1bc3f45c56874f51e33023402afa92f2952 100644 --- a/swh/model/hashutil.py +++ b/swh/model/hashutil.py @@ -1,21 +1,56 @@ -# Copyright (C) 2015 The Software Heritage developers +# Copyright (C) 2015-2017 The Software Heritage developers # See the AUTHORS file at the top-level directory of this distribution # License: GNU General Public License version 3, or any later version # See top-level LICENSE file for more information +"""Module in charge of hashing function definitions. This is the base +module use to compute swh's hashes. + +Only a subset of hashing algorithms is supported as defined in the +ALGORITHMS set. Any provided algorithms not in that list will result +in a ValueError explaining the error. + +This modules defines the following hashing functions: + +- hash_file: Hash the contents of the given file object with the given + algorithms (defaulting to DEFAULT_ALGORITHMS if none provided). + +- hash_data: Hash the given binary blob with the given algorithms + (defaulting to DEFAULT_ALGORITHMS if none provided). + +- hash_path: Hash the contents of the file at the given path with the + given algorithms (defaulting to DEFAULT_ALGORITHMS if none + provided). + +""" + import binascii import functools import hashlib -from io import BytesIO import os +import sys -# supported hashing algorithms -ALGORITHMS = set(['sha1', 'sha256', 'sha1_git']) +from io import BytesIO + +# Supported algorithms +ALGORITHMS = set(['sha1', 'sha256', 'sha1_git', 'blake2s256', 'blake2b512']) + +# Default algorithms used +DEFAULT_ALGORITHMS = set(['sha1', 'sha256', 'sha1_git', 'blake2s256']) # should be a multiple of 64 (sha1/sha256's block size) # FWIW coreutils' sha1sum uses 32768 HASH_BLOCK_SIZE = 32768 +# Prior to python3.4, only blake2 is available through pyblake2 module +# From 3.5 onwards, it's been integrated in python +if sys.version_info.major == 3 and sys.version_info.minor <= 4: + import pyblake2 + # register those hash algorithms in hashlib + __cache = hashlib.__builtin_constructor_cache + __cache['blake2s256'] = pyblake2.blake2s + __cache['blake2b512'] = pyblake2.blake2b + def _new_git_hash(base_algo, git_type, length): """Initialize a digest object (as returned by python's hashlib) for the @@ -46,16 +81,16 @@ def _new_git_hash(base_algo, git_type, length): def _new_hash(algo, length=None): - """Initialize a digest object (as returned by python's hashlib) for the - requested algorithm. See the constant ALGORITHMS for the list of supported - algorithms. If a git-specific hashing algorithm is requested (e.g., - "sha1_git"), the hashing object will be pre-fed with the needed header; for - this to work, length must be given. + """Initialize a digest object (as returned by python's hashlib) for + the requested algorithm. See the constant ALGORITHMS for the list + of supported algorithms. If a git-specific hashing algorithm is + requested (e.g., "sha1_git"), the hashing object will be pre-fed + with the needed header; for this to work, length must be given. Args: - algo: a hashing algorithm (one of ALGORITHMS) - length: the length of the hashed payload (needed for git-specific - algorithms) + algo (str): a hashing algorithm (one of ALGORITHMS) + length (int): the length of the hashed payload (needed for + git-specific algorithms) Returns: a hashutil.hash object @@ -63,25 +98,23 @@ def _new_hash(algo, length=None): Raises: ValueError if algo is unknown, or length is missing for a git-specific hash. + """ if algo not in ALGORITHMS: - raise ValueError('Unexpected hashing algorithm %s, ' - 'expected one of %s' % - (algo, ', '.join(sorted(ALGORITHMS)))) + raise ValueError( + 'Unexpected hashing algorithm %s, expected one of %s' % + (algo, ', '.join(sorted(ALGORITHMS)))) - h = None if algo.endswith('_git'): if length is None: raise ValueError('Missing length for git hashing algorithm') base_algo = algo[:-4] - h = _new_git_hash(base_algo, 'blob', length) - else: - h = hashlib.new(algo) + return _new_git_hash(base_algo, 'blob', length) - return h + return hashlib.new(algo) -def hash_file(fobj, length=None, algorithms=ALGORITHMS, chunk_cb=None): +def hash_file(fobj, length=None, algorithms=DEFAULT_ALGORITHMS, chunk_cb=None): """Hash the contents of the given file object with the given algorithms. Args: @@ -109,8 +142,9 @@ def hash_file(fobj, length=None, algorithms=ALGORITHMS, chunk_cb=None): return {algo: hash.digest() for algo, hash in hashes.items()} -def hash_path(path, algorithms=ALGORITHMS, chunk_cb=None): - """Hash the contents of the file at the given path with the given algorithms. +def hash_path(path, algorithms=DEFAULT_ALGORITHMS, chunk_cb=None): + """Hash the contents of the file at the given path with the given + algorithms. Args: path: the path of the file to hash @@ -122,6 +156,7 @@ def hash_path(path, algorithms=ALGORITHMS, chunk_cb=None): Raises: ValueError if algorithms contains an unknown hash algorithm. OSError on file access error + """ length = os.path.getsize(path) with open(path, 'rb') as fobj: @@ -130,7 +165,7 @@ def hash_path(path, algorithms=ALGORITHMS, chunk_cb=None): return hash -def hash_data(data, algorithms=ALGORITHMS): +def hash_data(data, algorithms=DEFAULT_ALGORITHMS): """Hash the given binary blob with the given algorithms. Args: diff --git a/swh/model/identifiers.py b/swh/model/identifiers.py index 4eb2b9d70df0c6230fe16be3de75792284eb2637..d51304e7e6d4bd917bb0fad3f5c099de32789318 100644 --- a/swh/model/identifiers.py +++ b/swh/model/identifiers.py @@ -7,7 +7,7 @@ import binascii import datetime from functools import lru_cache -from .hashutil import hash_data, hash_git_data +from .hashutil import hash_data, hash_git_data, DEFAULT_ALGORITHMS @lru_cache() @@ -91,12 +91,7 @@ def content_identifier(content): """ - hashes = hash_data( - content['data'], - {'sha1', 'sha1_git', 'sha256'}, - ) - - return hashes + return hash_data(content['data'], DEFAULT_ALGORITHMS) def _sort_key(entry): diff --git a/swh/model/tests/test_git.py b/swh/model/tests/test_git.py index 3c233c3b791b827ffcc18774eb2d4faba9f3d526..0bf81bc8c0e2aa250c87dd53b3ccd14644eebcbf 100644 --- a/swh/model/tests/test_git.py +++ b/swh/model/tests/test_git.py @@ -160,6 +160,8 @@ class ComputeBlobMetadata(unittest.TestCase): b'\xe4\x8cS\x91', 'sha256': b"\xe3\xb0\xc4B\x98\xfc\x1c\x14\x9a\xfb\xf4\xc8\x99o" b"\xb9$'\xaeA\xe4d\x9b\x93L\xa4\x95\x99\x1bxR\xb8U", + 'blake2s256': b'i!z0y\x90\x80\x94\xe1\x11!\xd0B5J|\x1fU\xb6H,\xa1' + b'\xa5\x1e\x1b%\r\xfd\x1e\xd0\xee\xf9', 'perms': git.GitPerm.BLOB, 'path': path, 'name': name, @@ -244,22 +246,23 @@ class GitHashFromScratch(GitHashWalkArborescenceTree, unittest.TestCase): actual_walk1[k] = walk1[k] expected_checksums = { - os.path.join(self.tmp_root_path, b'sample-folder/empty-folder'): [], # noqa - os.path.join(self.tmp_root_path, b'sample-folder/bar/barfoo'): [{ # noqa - 'type': git.GitType.BLOB, # noqa + os.path.join(self.tmp_root_path, b'sample-folder/empty-folder'): [], # noqa + os.path.join(self.tmp_root_path, b'sample-folder/bar/barfoo'): [{ # noqa + 'type': git.GitType.BLOB, # noqa 'length': 72, - 'sha256': b'=\xb5\xae\x16\x80U\xbc\xd9:M\x08(]\xc9\x9f\xfe\xe2\x883\x03\xb2?\xac^\xab\x85\x02s\xa8\xeaUF', # noqa - 'name': b'another-quote.org', # noqa - 'path': os.path.join(self.tmp_root_path, b'sample-folder/bar/barfoo/another-quote.org'), # noqa - 'perms': git.GitPerm.BLOB, # noqa - 'sha1': b'\x90\xa6\x13\x8b\xa5\x99\x15&\x1e\x17\x99H8j\xa1\xcc*\xa9"\n', # noqa - 'sha1_git': b'\x136\x93\xb1%\xba\xd2\xb4\xac1\x855\xb8I\x01\xeb\xb1\xf6\xb68'}], # noqa - os.path.join(self.tmp_root_path, b'sample-folder/bar'): [{ # noqa - 'type': git.GitType.TREE, # noqa - 'perms': git.GitPerm.TREE, # noqa - 'name': b'barfoo', # noqa - 'path': os.path.join(self.tmp_root_path, b'sample-folder/bar/barfoo'), # noqa - 'sha1_git': b'\xc3\x02\x0fk\xf15\xa3\x8cm\xf3\xaf\xeb_\xb3\x822\xc5\xe0p\x87'}]} # noqa + 'sha256': b'=\xb5\xae\x16\x80U\xbc\xd9:M\x08(]\xc9\x9f\xfe\xe2\x883\x03\xb2?\xac^\xab\x85\x02s\xa8\xeaUF', # noqa + 'name': b'another-quote.org', # noqa + 'path': os.path.join(self.tmp_root_path, b'sample-folder/bar/barfoo/another-quote.org'), # noqa + 'perms': git.GitPerm.BLOB, # noqa + 'sha1': b'\x90\xa6\x13\x8b\xa5\x99\x15&\x1e\x17\x99H8j\xa1\xcc*\xa9"\n', # noqa + 'blake2s256': b'\xd2l\x1c\xad\x82\xd4=\xf0\xbf\xfa^{\xe1\x1a`\xe3J\xdb\x85\xa2\x18\xb43\xcb\xceRx\xb1\x0b\x95O\xe8', # noqa + 'sha1_git': b'\x136\x93\xb1%\xba\xd2\xb4\xac1\x855\xb8I\x01\xeb\xb1\xf6\xb68'}], # noqa + os.path.join(self.tmp_root_path, b'sample-folder/bar'): [{ # noqa + 'type': git.GitType.TREE, # noqa + 'perms': git.GitPerm.TREE, # noqa + 'name': b'barfoo', # noqa + 'path': os.path.join(self.tmp_root_path, b'sample-folder/bar/barfoo'), # noqa + 'sha1_git': b'\xc3\x02\x0fk\xf15\xa3\x8cm\xf3\xaf\xeb_\xb3\x822\xc5\xe0p\x87'}]} # noqa self.assertEquals(actual_walk1, expected_checksums) @@ -286,6 +289,7 @@ class WithSampleFolderChecksums: super().setUp() self.rootkey = b'/tmp/tmp7w3oi_j8' + self.objects = { b'/tmp/tmp7w3oi_j8': { 'children': {b'/tmp/tmp7w3oi_j8/sample-folder'}, @@ -330,6 +334,7 @@ class WithSampleFolderChecksums: 'sha1': b'\xd0$\x87\x14\x94\x8b:H\xa2T8#*o\x99\xf01\x8fY\xf1', # noqa 'data': b'some-binary', 'sha1_git': b'\xe8kE\xe58\xd9\xb6\x88\x8c\x96\x9c\x89\xfb\xd2*\x85\xaa\x0e\x03f', # noqa + 'blake2s256': b'\x9c\xe1\x8b\x1a\xde\xcb3\xf8\x91\xca6fM\xa6v\xe1,w,\xc1\x93w\x8a\xac\x9a\x13{\x8d\xc5\x83K\x9b', # noqa 'path': b'/tmp/tmp7w3oi_j8/sample-folder/link-to-binary', 'sha256': b'\x14\x12n\x97\xd8?}&\x1cZh\x89\xce\xe76\x19w\x0f\xf0\x9e@\xc5I\x86\x85\xab\xa7E\xbe\x88.\xff', # noqa 'perms': git.GitPerm.LINK, @@ -343,6 +348,7 @@ class WithSampleFolderChecksums: 'sha1': b'\xcb\xee\xd1^yY\x9c\x90\xdes\x83\xf4 \xfe\xd7\xac\xb4\x8e\xa1q', # noqa 'data': b'bar/barfoo/another-quote.org', 'sha1_git': b'}\\\x08\x11\x1e!\xc8\xa9\xf7\x15@\x93\x99\x98U\x16\x837_\xad', # noqa + 'blake2s256': b"-\x0es\xce\xa0\x1b\xa9I\xc1\x02-\xc1\x0c\x8aC\xe6a\x80c\x96b\xe5\xdc'7\xb8C8/{\x19\x10", # noqa 'path': b'/tmp/tmp7w3oi_j8/sample-folder/link-to-another-quote', # noqa 'sha256': b'\xe6\xe1}\x07\x93\xaau\n\x04@\xeb\x9a\xd5\xb8\x0b%\x80vc~\xf0\xfbh\xf3\xac.Y\xe4\xb9\xac;\xa6', # noqa 'perms': git.GitPerm.LINK, @@ -356,6 +362,7 @@ class WithSampleFolderChecksums: 'sha1': b'\x0b\xee\xc7\xb5\xea?\x0f\xdb\xc9]\r\xd4\x7f<[\xc2u\xda\x8a3', # noqa 'data': b'foo', 'sha1_git': b'\x19\x10(\x15f=#\xf8\xb7ZG\xe7\xa0\x19e\xdc\xdc\x96F\x8c', # noqa + 'blake2s256': b'\x08\xd6\xca\xd8\x80u\xde\x8f\x19-\xb0\x97W=\x0e\x82\x94\x11\xcd\x91\xebn\xc6^\x8f\xc1l\x01~\xdf\xdbt', # noqa 'path': b'/tmp/tmp7w3oi_j8/sample-folder/link-to-foo', 'sha256': b',&\xb4kh\xff\xc6\x8f\xf9\x9bE<\x1d0A4\x13B-pd\x83\xbf\xa0\xf9\x8a^\x88bf\xe7\xae', # noqa 'perms': git.GitPerm.LINK, @@ -368,6 +375,7 @@ class WithSampleFolderChecksums: 'name': b'some-binary', 'sha1': b'\x0b\xbc\x12\xd7\xf4\xa2\xa1[\x14=\xa8F\x17\xd9\\\xb2#\xc9\xb2<', # noqa 'sha1_git': b'hv\x95y\xc3\xea\xad\xbeUSy\xb9\xc3S\x8ef(\xba\xe1\xeb', # noqa + 'blake2s256': b"\x92.\x0fp\x15\x03R\x12I[\t\x0c'WsW\xa7@\xdd\xd7{\x0b\x9e\x0c\xd2;T\x80\xc0z\x18\xc6", # noqa 'path': b'/tmp/tmp7w3oi_j8/sample-folder/some-binary', 'sha256': b'\xba\xc6P\xd3Jv8\xbb\n\xebSBdm$\xe3\xb9\xadkD\xc9\xb3\x83b\x1f\xaaH+\x99\n6}', # noqa 'perms': git.GitPerm.EXEC, @@ -394,6 +402,7 @@ class WithSampleFolderChecksums: 'checksums': {'name': b'another-quote.org', 'sha1': b'\x90\xa6\x13\x8b\xa5\x99\x15&\x1e\x17\x99H8j\xa1\xcc*\xa9"\n', # noqa 'sha1_git': b'\x136\x93\xb1%\xba\xd2\xb4\xac1\x855\xb8I\x01\xeb\xb1\xf6\xb68', # noqa + 'blake2s256': b'\xd2l\x1c\xad\x82\xd4=\xf0\xbf\xfa^{\xe1\x1a`\xe3J\xdb\x85\xa2\x18\xb43\xcb\xceRx\xb1\x0b\x95O\xe8', # noqa 'path': b'/tmp/tmp7w3oi_j8/sample-folder/bar/barfoo/another-quote.org', # noqa 'sha256': b'=\xb5\xae\x16\x80U\xbc\xd9:M\x08(]\xc9\x9f\xfe\xe2\x883\x03\xb2?\xac^\xab\x85\x02s\xa8\xeaUF', # noqa 'perms': git.GitPerm.BLOB, @@ -417,6 +426,7 @@ class WithSampleFolderChecksums: 'sha1': b'\x90W\xeem\x01bPn\x01\xc4\xd9\xd5E\x9az\xdd\x1f\xed\xac7', # noqa 'data': b'bar/barfoo', 'sha1_git': b'\x81\x85\xdf\xb2\xc0\xc2\xc5\x97\xd1ou\xa8\xa0\xc3vhV|=~', # noqa + 'blake2s256': b'\xe1%/,\xaaJre<N\xfd\x9a\xf8q\xb6+\xf2\xab\xb7\xbb/\x1b\x0e\x95\x96\x92\x04\xbd\x8ap\xd4\xcd', # noqa 'path': b'/tmp/tmp7w3oi_j8/sample-folder/foo/barfoo', # noqa 'sha256': b')\xad?W%2\x1b\x94\x032\xc7\x8e@6\x01\xaf\xffa\xda\xea\x85\xe9\xc8\x0bJpc\xb6\x88~\xadh', # noqa 'perms': git.GitPerm.LINK, @@ -430,6 +440,7 @@ class WithSampleFolderChecksums: 'sha1_git': b'\xac\xac2m\xddc\xb0\xbcp\x84\x06Y\xd4\xacCa\x94\x84\xe6\x9f', # noqa 'path': b'/tmp/tmp7w3oi_j8/sample-folder/foo/rel-link-to-barfoo', # noqa 'sha256': b'\x80\x07\xd2\r\xb2\xaf@C_B\xdd\xefK\x8a\xd7k\x80\xad\xbe\xc2k$\x9f\xdf\x04s5?\x8d\x99\xdf\x08', # noqa + 'blake2s256': b"\xd9\xc3'B\x15\x88\xa1\xcfa\xf3\x16aP\x05\xa2\xe9\xc1:\xc3\xa4\xe9mC\xa2A8\xd7\x18\xfa\x0e0\xdb", # noqa 'perms': git.GitPerm.LINK, 'type': git.GitType.BLOB, 'length': 13} @@ -438,6 +449,7 @@ class WithSampleFolderChecksums: 'checksums': {'name': b'quotes.md', 'sha1': b'\x1b\xf0\xbbr\x1a\xc9,\x18\xa1\x9b\x13\xc0\xeb=t\x1c\xbf\xad\xeb\xfc', # noqa 'sha1_git': b'|LW\xba\x9f\xf4\x96\xad\x17\x9b\x8fe\xb1\xd2\x86\xed\xbd\xa3L\x9a', # noqa + 'blake2s256': b'\xbf|\xe4\xfe0Cxe\x1e\xe64\x8d>\x936\xedZ\xd6\x03\xd3>\x83\xc8;\xa4\xe1KF\xf9\xb8\xa8\x0b', # noqa 'path': b'/tmp/tmp7w3oi_j8/sample-folder/foo/quotes.md', # noqa 'sha256': b'\xca\xca\x94*\xed\xa7\xb3\x08\x85\x9e\xb5o\x90\x9e\xc9m\x07\xa4\x99I\x16\x90\xc4S\xf7;\x98\x00\xa9;\x16Y', # noqa 'perms': git.GitPerm.BLOB, diff --git a/swh/model/tests/test_hashutil.py b/swh/model/tests/test_hashutil.py index 614e7ee282de9ed52fa41f2394819c861b18ce76..c9f47e1e6b34289a3196b05c7d2a5c973bbc6fcc 100644 --- a/swh/model/tests/test_hashutil.py +++ b/swh/model/tests/test_hashutil.py @@ -8,6 +8,7 @@ import tempfile import unittest from nose.tools import istest +from unittest.mock import patch from swh.model import hashutil @@ -20,6 +21,8 @@ class Hashutil(unittest.TestCase): 'sha1_git': '568aaf43d83b2c3df8067f3bedbb97d83260be6d', 'sha256': '26602113b4b9afd9d55466b08580d3c2' '4a9b50ee5b5866c0d91fab0e65907311', + 'blake2s256': '63cfb259e1fdb485bc5c55749697a6b21ef31fb7445f6c78a' + 'c9422f9f2dc8906', } self.checksums = { @@ -124,6 +127,36 @@ class Hashutil(unittest.TestCase): hashutil.bytehex_to_hash( self.hex_checksums[algo].encode())) + @istest + def new_hash_unsupported_hashing_algorithm(self): + try: + hashutil._new_hash('blake2:10') + except ValueError as e: + self.assertEquals(str(e), + 'Unexpected hashing algorithm blake2:10, ' + 'expected one of blake2b512, blake2s256, ' + 'sha1, sha1_git, sha256') + + @patch('swh.model.hashutil.hashlib') + @istest + def new_hash_blake2b(self, mock_hashlib): + mock_hashlib.new.return_value = 'some-hashlib-object' + + h = hashutil._new_hash('blake2b512') + + self.assertEquals(h, 'some-hashlib-object') + mock_hashlib.new.assert_called_with('blake2b512') + + @patch('swh.model.hashutil.hashlib') + @istest + def new_hash_blake2s(self, mock_hashlib): + mock_hashlib.new.return_value = 'some-hashlib-object' + + h = hashutil._new_hash('blake2s256') + + self.assertEquals(h, 'some-hashlib-object') + mock_hashlib.new.assert_called_with('blake2s256') + class HashlibGit(unittest.TestCase): diff --git a/swh/model/tests/test_validators.py b/swh/model/tests/test_validators.py index 6f2865888351584955288927f6b90899165793d6..60a1de42952167c54d94979eb18118a0ad32ee8a 100644 --- a/swh/model/tests/test_validators.py +++ b/swh/model/tests/test_validators.py @@ -67,9 +67,9 @@ class TestValidators(unittest.TestCase): hash_mismatches = exc.error_dict[exceptions.NON_FIELD_ERRORS] self.assertIsInstance(hash_mismatches, list) - self.assertEqual(len(hash_mismatches), 3) + self.assertEqual(len(hash_mismatches), 4) self.assertTrue(all(mismatch.code == 'content-hash-mismatch' for mismatch in hash_mismatches)) self.assertEqual(set(mismatch.params['hash'] for mismatch in hash_mismatches), - {'sha1', 'sha1_git', 'sha256'}) + {'sha1', 'sha1_git', 'sha256', 'blake2s256'}) diff --git a/version.txt b/version.txt index ed4e55cb1a5c9150320ab6e9463f5a5ffc8ddee9..4eb8537882dd1b05b031d6dbd42abfdac3dc61d5 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -v0.0.14-0-g3e325ca \ No newline at end of file +v0.0.15-0-g4d6d748 \ No newline at end of file