Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7343108
D2908.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Subscribers
None
D2908.diff
View Options
diff --git a/swh/storage/tests/storage_data.py b/swh/storage/tests/storage_data.py
--- a/swh/storage/tests/storage_data.py
+++ b/swh/storage/tests/storage_data.py
@@ -201,7 +201,7 @@
'date': {
'timestamp': 1234567890,
'offset': 120,
- 'negative_utc': None,
+ 'negative_utc': False,
},
'committer': {
'name': b'St\xc3fano Zacchiroli',
@@ -245,7 +245,7 @@
'microseconds': 220000,
},
'offset': -720,
- 'negative_utc': None,
+ 'negative_utc': False,
},
'committer': {
'name': b'tony',
@@ -279,7 +279,7 @@
'microseconds': 220000,
},
'offset': -720,
- 'negative_utc': None,
+ 'negative_utc': False,
},
'committer': {
'name': b'tony',
@@ -313,7 +313,7 @@
'microseconds': 220000,
},
'offset': -720,
- 'negative_utc': None,
+ 'negative_utc': False,
},
'committer': {
'name': b'committer-dude',
@@ -326,7 +326,7 @@
'microseconds': 220000,
},
'offset': -720,
- 'negative_utc': None,
+ 'negative_utc': False,
},
'parents': [hash_to_bytes( # revision3
'7026b7c1a2af56521e951c01ed20f255fa054238')],
@@ -391,7 +391,7 @@
'date': {
'timestamp': 1234567890,
'offset': 42,
- 'negative_utc': None,
+ 'negative_utc': False,
},
'target': b'43210987654321098765',
'target_type': 'revision',
@@ -410,7 +410,7 @@
'date': {
'timestamp': 1634366813,
'offset': -120,
- 'negative_utc': None,
+ 'negative_utc': False,
},
'target': b'432109\xa9765432\xc309\x00765',
'target_type': 'revision',
diff --git a/swh/storage/tests/test_retry.py b/swh/storage/tests/test_retry.py
--- a/swh/storage/tests/test_retry.py
+++ b/swh/storage/tests/test_retry.py
@@ -3,6 +3,7 @@
# License: GNU General Public License version 3, or any later version
# See top-level LICENSE file for more information
+from datetime import datetime
from typing import Dict
from unittest.mock import call
@@ -266,7 +267,10 @@
origin = list(swh_storage.origin_visit_get(origin_url))
assert not origin
- origin_visit = swh_storage.origin_visit_add(origin_url, '2020-01-01', 'hg')
+ origin_visit = swh_storage.origin_visit_add(
+ origin_url,
+ datetime(2020, 1, 1),
+ 'hg')
assert origin_visit.origin == origin_url
assert isinstance(origin_visit.visit, int)
@@ -300,13 +304,16 @@
origin = list(swh_storage.origin_visit_get(origin_url))
assert not origin
- r = swh_storage.origin_visit_add(origin_url, '2020-01-01', 'git')
+ r = swh_storage.origin_visit_add(
+ origin_url,
+ datetime(2020, 1, 1),
+ 'git')
assert r == {'origin': origin_url, 'visit': 1}
mock_memory.assert_has_calls([
- call(origin_url, '2020-01-01', 'git'),
- call(origin_url, '2020-01-01', 'git'),
- call(origin_url, '2020-01-01', 'git')
+ call(origin_url, datetime(2020, 1, 1), 'git'),
+ call(origin_url, datetime(2020, 1, 1), 'git'),
+ call(origin_url, datetime(2020, 1, 1), 'git')
])
assert mock_sleep.call_count == 2
@@ -327,10 +334,15 @@
assert not origin
with pytest.raises(StorageArgumentException, match='Refuse to add'):
- swh_storage.origin_visit_add(origin_url, '2020-01-31', 'svn')
+ swh_storage.origin_visit_add(
+ origin_url,
+ datetime(2020, 1, 31),
+ 'svn')
mock_memory.assert_has_calls([
- call(origin_url, '2020-01-31', 'svn'),
+ call(origin_url,
+ datetime(2020, 1, 31),
+ 'svn'),
])
@@ -599,7 +611,10 @@
"""
sample_origin = sample_data['origin'][0]
origin_url = swh_storage.origin_add_one(sample_origin)
- origin_visit = swh_storage.origin_visit_add(origin_url, '2020-01-01', 'hg')
+ origin_visit = swh_storage.origin_visit_add(
+ origin_url,
+ datetime(2020, 1, 1),
+ 'hg')
ov = next(swh_storage.origin_visit_get(origin_url))
assert ov['origin'] == origin_url
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mar 17 2025, 7:26 PM (7 w, 3 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3215227
Attached To
D2908: tests: fix types of several test data sets
Event Timeline
Log In to Comment