Page MenuHomeSoftware Heritage

Jenkins > .tox.py3.lib.python3.7.site-packages.swh.storage.tests.test_api_client.TestStorage::test_origin_visit_status_add_twice
Failed

TEST RESULT

Run At
Jul 27 2020, 10:17 PM
Details
self = <swh.storage.tests.test_api_client.TestStorage object at 0x7fc052d6b1d0> swh_storage = <RemoteStorage url=mock://example.com/> sample_data = <swh.storage.tests.storage_data.StorageData object at 0x7fc052d4e4e0> def test_origin_visit_status_add_twice(self, swh_storage, sample_data): """Correct origin visit statuses should add a new visit status """ snapshot = sample_data.snapshot origin1 = sample_data.origins[1] swh_storage.origin_add([origin1]) ov1 = swh_storage.origin_visit_add( [ OriginVisit( origin=origin1.url, date=sample_data.date_visit1, type=sample_data.type_visit1, ), ] )[0] ovs1 = OriginVisitStatus( origin=origin1.url, visit=ov1.visit, date=sample_data.date_visit1, status="created", snapshot=None, ) date_visit_now = now() visit_status1 = OriginVisitStatus( origin=ov1.origin, visit=ov1.visit, date=date_visit_now, status="full", snapshot=snapshot.id, ) swh_storage.origin_visit_status_add([visit_status1]) # second call will ignore existing entries (will send to storage though) swh_storage.origin_visit_status_add([visit_status1]) origin_visits = list(swh_storage.origin_visit_get(ov1.origin)) assert len(origin_visits) == 1 origin_visit1 = origin_visits[0] assert origin_visit1 > assert origin_visit1["status"] == "full" E TypeError: string indices must be integers .tox/py3/lib/python3.7/site-packages/swh/storage/tests/test_storage.py:1750: TypeError