diff --git a/swh/loader/core/tests/test_loader.py b/swh/loader/core/tests/test_loader.py --- a/swh/loader/core/tests/test_loader.py +++ b/swh/loader/core/tests/test_loader.py @@ -74,7 +74,6 @@ self.storage = self.loader.storage contents = [ { - 'id': '34973274ccef6ab4dfaaf86599792fa9c3fe4689', 'sha1': '34973274ccef6ab4dfaaf86599792fa9c3fe4689', 'sha1_git': b'bar1', 'sha256': b'baz1', @@ -84,7 +83,6 @@ 'length': 5, }, { - 'id': '61c2b3a30496d329e21af70dd2d7e097046d07b7', 'sha1': '61c2b3a30496d329e21af70dd2d7e097046d07b7', 'sha1_git': b'bar2', 'sha256': b'baz2', @@ -94,12 +92,12 @@ 'length': 5, }, ] - self.expected_contents = [content['id'] for content in contents] + self.expected_contents = [content['sha1'] for content in contents] self.in_contents = contents.copy() for content in self.in_contents: content['sha1'] = hash_to_bytes(content['sha1']) self.in_directories = [ - {'id': hash_to_bytes(id_)} + {'id': hash_to_bytes(id_), 'entries': []} for id_ in [ '44e45d56f88993aae6a0198013efa80716fd8921', '54e45d56f88993aae6a0198013efa80716fd8920', @@ -111,30 +109,56 @@ 'email': b'john.doe@institute.org', 'fullname': b'John Doe ' } + rev1_id = b'\x00'*20 + rev2_id = b'\x01'*20 self.in_revisions = [ { - 'id': b'rev1', - 'date': None, + 'id': rev1_id, + 'type': 'git', + 'date': 1567591673, + 'committer_date': 1567591673, 'author': person, - 'committer': person + 'committer': person, + 'message': b'msg1', + 'directory': None, + 'synthetic': False, + 'metadata': None, + 'parents': [], }, { - 'id': b'rev2', - 'date': None, + 'id': rev2_id, + 'type': 'hg', + 'date': 1567591673, + 'committer_date': 1567591673, 'author': person, - 'committer': person + 'committer': person, + 'message': b'msg2', + 'directory': None, + 'synthetic': False, + 'metadata': None, + 'parents': [], }, ] self.in_releases = [ { - 'id': b'rel1', + 'name': b'rel1', + 'id': b'\x02'*20, 'date': None, - 'author': person + 'author': person, + 'target_type': 'revision', + 'target': rev1_id, + 'message': None, + 'synthetic': False, }, { - 'id': b'rel2', + 'name': b'rel2', + 'id': b'\x03'*20, 'date': None, - 'author': person + 'author': person, + 'target_type': 'revision', + 'target': rev2_id, + 'message': None, + 'synthetic': False, }, ] self.in_origin = {