Page MenuHomeSoftware Heritage

D1542.id5077.diff
No OneTemporary

D1542.id5077.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
@@ -555,7 +555,10 @@
def test_content_add(self):
cont = self.cont
+ insertion_start_time = datetime.datetime.now(tz=datetime.timezone.utc)
actual_result = self.storage.content_add([cont])
+ insertion_end_time = datetime.datetime.now(tz=datetime.timezone.utc)
+
self.assertEqual(actual_result, {
'content:add': 1,
'content:add:bytes': cont['length'],
@@ -569,8 +572,9 @@
del expected_cont['data']
journal_objects = list(self.journal_writer.objects)
for (obj_type, obj) in journal_objects:
- if 'ctime' in obj:
- del obj['ctime']
+ self.assertLessEqual(insertion_start_time, obj['ctime'])
+ self.assertLessEqual(obj['ctime'], insertion_end_time)
+ del obj['ctime']
self.assertEqual(journal_objects,
[('content', expected_cont)])
@@ -622,8 +626,7 @@
del expected_cont['data']
journal_objects = list(self.journal_writer.objects)
for (obj_type, obj) in journal_objects:
- if 'ctime' in obj:
- del obj['ctime']
+ del obj['ctime']
self.assertEqual(journal_objects,
[('content', expected_cont)])

File Metadata

Mime Type
text/plain
Expires
Thu, Jul 3, 3:22 PM (1 w, 2 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3233858

Event Timeline