Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7066682
D1546.id5190.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
988 B
Subscribers
None
D1546.id5190.diff
View Options
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
Details
Attached
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
Attached To
D1546: Add test for content_add when one of the content is already known.
Event Timeline
Log In to Comment