Page MenuHomeSoftware Heritage

D1546.id5190.diff
No OneTemporary

D1546.id5190.diff

diff --git a/swh/storage/tests/test_storage.py b/swh/storage/tests/test_storage.py
--- a/swh/storage/tests/test_storage.py
+++ b/swh/storage/tests/test_storage.py
@@ -636,6 +636,24 @@
'skipped_content:add': 0
})
+ def test_content_add_again(self):
+ actual_result = self.storage.content_add([self.cont])
+ self.assertEqual(actual_result, {
+ 'content:add': 1,
+ 'content:add:bytes': self.cont['length'],
+ 'skipped_content:add': 0
+ })
+
+ actual_result = self.storage.content_add([self.cont, self.cont2])
+ self.assertEqual(actual_result, {
+ 'content:add': 1,
+ 'content:add:bytes': self.cont2['length'],
+ 'skipped_content:add': 0
+ })
+
+ self.assertEqual(len(self.storage.content_find(self.cont)), 1)
+ self.assertEqual(len(self.storage.content_find(self.cont2)), 1)
+
def test_content_add_db(self):
cont = self.cont

File Metadata

Mime Type
text/plain
Expires
Nov 5 2024, 6:15 PM (11 w, 14 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3221361

Event Timeline