diff --git a/swh/objstorage/replayer/tests/test_cli.py b/swh/objstorage/replayer/tests/test_cli.py --- a/swh/objstorage/replayer/tests/test_cli.py +++ b/swh/objstorage/replayer/tests/test_cli.py @@ -20,7 +20,7 @@ import yaml from swh.journal.serializers import key_to_kafka -from swh.model.hashutil import hash_to_hex +from swh.model.hashutil import MultiHash, hash_to_hex from swh.objstorage.backends.in_memory import InMemoryObjStorage from swh.objstorage.replayer.cli import objstorage_cli_group from swh.objstorage.replayer.replay import CONTENT_REPLAY_RETRIES @@ -113,7 +113,8 @@ contents = {} for i in range(NUM_CONTENTS): content = b"\x00" * 19 + bytes([i]) - sha1 = objstorage.add(content) + sha1 = MultiHash(["sha1"]).from_data(content).digest()["sha1"] + objstorage.add(content=content, obj_id=sha1) contents[sha1] = content producer.produce( topic=kafka_prefix + ".content", diff --git a/swh/objstorage/replayer/tests/test_replay.py b/swh/objstorage/replayer/tests/test_replay.py --- a/swh/objstorage/replayer/tests/test_replay.py +++ b/swh/objstorage/replayer/tests/test_replay.py @@ -50,7 +50,7 @@ ) for content in CONTENTS: - objstorage1.add(content.data) + objstorage1.add(content.data, obj_id=content.sha1) writer.write_addition("content", content) replayer = JournalClient( diff --git a/swh/objstorage/replayer/tests/test_statsd.py b/swh/objstorage/replayer/tests/test_statsd.py --- a/swh/objstorage/replayer/tests/test_statsd.py +++ b/swh/objstorage/replayer/tests/test_statsd.py @@ -49,7 +49,7 @@ ] for content in contents: - objstorage1.add(content.data) + objstorage1.add(content.data, obj_id=content.sha1) writer.write_addition("content", content) excluded = [c.sha1 for c in contents[2:4]] @@ -57,7 +57,7 @@ return cnt_d["sha1"] in excluded for content in contents[4:6]: - objstorage2.add(content.data) + objstorage2.add(content.data, obj_id=content.sha1) replayer = JournalClient( brokers=kafka_server,