Page MenuHomeSoftware Heritage

D2830.id10060.diff
No OneTemporary

D2830.id10060.diff

diff --git a/requirements-test.txt b/requirements-test.txt
--- a/requirements-test.txt
+++ b/requirements-test.txt
@@ -7,4 +7,5 @@
requests-mock
swh.core[http] >= 0.0.81
swh.loader.git >= 0.0.55
+swh.storage >= 0.0.178
decorator # dependency of swh.core[http]
diff --git a/swh/web/tests/api/views/test_origin.py b/swh/web/tests/api/views/test_origin.py
--- a/swh/web/tests/api/views/test_origin.py
+++ b/swh/web/tests/api/views/test_origin.py
@@ -116,7 +116,7 @@
new_origin.url, visit_date, type='git')
archive_data.snapshot_add([new_snapshots[i]])
archive_data.origin_visit_update(
- new_origin.url, origin_visit['visit'],
+ new_origin.url, origin_visit.visit,
snapshot=new_snapshots[i].id)
all_visits = list(reversed(get_origin_visits(new_origin.to_dict())))
@@ -152,7 +152,7 @@
new_origin.url, visit_date, type='git')
archive_data.snapshot_add([new_snapshots[i]])
archive_data.origin_visit_update(
- new_origin.url, origin_visit['visit'],
+ new_origin.url, origin_visit.visit,
snapshot=new_snapshots[i].id)
all_visits = list(reversed(get_origin_visits(new_origin.to_dict())))
@@ -186,10 +186,10 @@
for i, visit_date in enumerate(visit_dates):
origin_visit = archive_data.origin_visit_add(
new_origin.url, visit_date, type='git')
- visit_id = origin_visit['visit']
+ visit_id = origin_visit.visit
archive_data.snapshot_add([new_snapshots[i]])
archive_data.origin_visit_update(
- new_origin.url, origin_visit['visit'],
+ new_origin.url, visit_id,
snapshot=new_snapshots[i].id)
url = reverse('api-1-origin-visit',
url_args={'origin_url': new_origin.url,
@@ -234,7 +234,7 @@
for i, visit_date in enumerate(visit_dates):
origin_visit = archive_data.origin_visit_add(
new_origin.url, visit_date, type='git')
- visit_ids.append(origin_visit['visit'])
+ visit_ids.append(origin_visit.visit)
archive_data.snapshot_add([new_snapshots[0]])
archive_data.origin_visit_update(
@@ -269,7 +269,7 @@
for i, visit_date in enumerate(visit_dates):
origin_visit = archive_data.origin_visit_add(
new_origin.url, visit_date, type='git')
- visit_ids.append(origin_visit['visit'])
+ visit_ids.append(origin_visit.visit)
archive_data.snapshot_add([new_snapshots[0]])
archive_data.origin_visit_update(
diff --git a/swh/web/tests/browse/views/test_origin.py b/swh/web/tests/browse/views/test_origin.py
--- a/swh/web/tests/browse/views/test_origin.py
+++ b/swh/web/tests/browse/views/test_origin.py
@@ -272,7 +272,7 @@
archive_data.snapshot_add([Snapshot.from_dict(snp_dict)])
visit = archive_data.origin_visit_add(
new_origin['url'], visit_dates[0], type='git')
- archive_data.origin_visit_update(new_origin['url'], visit['visit'],
+ archive_data.origin_visit_update(new_origin['url'], visit.visit,
status='partial',
snapshot=snp_dict['id'])
@@ -297,7 +297,7 @@
archive_data.snapshot_add([Snapshot.from_dict(snp_dict)])
visit = archive_data.origin_visit_add(
new_origin['url'], visit_dates[0], type='git')
- archive_data.origin_visit_update(new_origin['url'], visit['visit'],
+ archive_data.origin_visit_update(new_origin['url'], visit.visit,
status='full',
snapshot=snp_dict['id'])
diff --git a/swh/web/tests/common/test_service.py b/swh/web/tests/common/test_service.py
--- a/swh/web/tests/common/test_service.py
+++ b/swh/web/tests/common/test_service.py
@@ -208,7 +208,7 @@
visits.append(archive_data.origin_visit_add(
new_origin.url, ts, type='git'))
- visit = random.choice(visits)['visit']
+ visit = random.choice(visits).visit
actual_origin_visit = service.lookup_origin_visit(
new_origin.url, visit)
diff --git a/swh/web/tests/data.py b/swh/web/tests/data.py
--- a/swh/web/tests/data.py
+++ b/swh/web/tests/data.py
@@ -192,7 +192,7 @@
search.origin_update([{'url': url, 'has_visits': True}])
visit = storage.origin_visit_add(url, '2019-12-03 13:55:05', 'tar')
storage.origin_visit_update(
- url, visit['visit'],
+ url, visit.visit,
snapshot='1a8893e6a86f444e8be8e7bda6cb34fb1735a00e')
contents = set()

File Metadata

Mime Type
text/plain
Expires
Tue, Dec 17, 3:46 PM (2 d, 20 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3219169

Event Timeline