diff --git a/swh/vault/tests/conftest.py b/swh/vault/tests/conftest.py --- a/swh/vault/tests/conftest.py +++ b/swh/vault/tests/conftest.py @@ -52,14 +52,12 @@ 'db': db_url('tests', postgresql_proc), 'storage': { 'cls': 'local', - 'args': { - 'db': db_url('tests2', postgresql_proc), - 'objstorage': { - 'cls': 'pathslicing', - 'args': { - 'root': str(tmp_path), - 'slicing': '0:1/1:5', - }, + 'db': db_url('tests2', postgresql_proc), + 'objstorage': { + 'cls': 'pathslicing', + 'args': { + 'root': str(tmp_path), + 'slicing': '0:1/1:5', }, }, }, diff --git a/swh/vault/tests/test_cookers.py b/swh/vault/tests/test_cookers.py --- a/swh/vault/tests/test_cookers.py +++ b/swh/vault/tests/test_cookers.py @@ -481,13 +481,11 @@ dir_id_hex = repo.repo[c].tree.decode() dir_id = hashutil.hash_to_bytes(dir_id_hex) - test_id = b'56789012345678901234' test_revision = Revision.from_dict({ - 'id': test_id, - 'message': None, - 'author': {'name': None, 'email': None, 'fullname': ''}, + 'message': b'', + 'author': {'name': None, 'email': None, 'fullname': b''}, 'date': None, - 'committer': {'name': None, 'email': None, 'fullname': ''}, + 'committer': {'name': None, 'email': None, 'fullname': b''}, 'committer_date': None, 'parents': [], 'type': 'git', @@ -498,17 +496,15 @@ swh_storage.revision_add([test_revision]) - with cook_extract_revision_gitfast(swh_storage, test_id) as (ert, p): + with cook_extract_revision_gitfast(swh_storage, + test_revision.id) as (ert, p): ert.checkout(b'HEAD') assert (p / 'file').stat().st_mode == 0o100644 def test_revision_revision_data(self, swh_storage): target_rev = '0e8a3ad980ec179856012b7eecf4327e99cd44cd' - d = hashutil.hash_to_bytes('17a3e48bce37be5226490e750202ad3a9a1a3fe9') - r = hashutil.hash_to_bytes('1ecc9270c4fc61cfddbc65a774e91ef5c425a6f0') dir = Directory.from_dict({ - 'id': d, 'entries': [ { 'name': b'submodule', @@ -521,20 +517,19 @@ swh_storage.directory_add([dir]) rev = Revision.from_dict({ - 'id': r, - 'message': None, - 'author': {'name': None, 'email': None, 'fullname': ''}, + 'message': b'', + 'author': {'name': None, 'email': None, 'fullname': b''}, 'date': None, - 'committer': {'name': None, 'email': None, 'fullname': ''}, + 'committer': {'name': None, 'email': None, 'fullname': b''}, 'committer_date': None, 'parents': [], 'type': 'git', - 'directory': d, + 'directory': dir.id, 'metadata': {}, 'synthetic': True }) swh_storage.revision_add([rev]) - with cook_stream_revision_gitfast(swh_storage, r) as stream: + with cook_stream_revision_gitfast(swh_storage, rev.id) as stream: pattern = 'M 160000 {} submodule'.format(target_rev).encode() assert pattern in stream.read()