Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/tests/storage_data.py
Show First 20 Lines • Show All 319 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
origin2 = { | origin2 = { | ||||
"url": "file:///dev/zero", | "url": "file:///dev/zero", | ||||
} | } | ||||
origins = (origin, origin2) | origins = (origin, origin2) | ||||
provider = { | metadata_authority = { | ||||
moranegg: above the type is only `deposit` | |||||
Done Inline Actionsindeed vlorentz: indeed | |||||
"name": "hal", | "type": "deposit", | ||||
"type": "deposit-client", | "url": "http://hal.inria.example.com/", | ||||
Not Done Inline Actionsthis looks like a wrong url (I don't know if this is a good or bad thing for a test) moranegg: this looks like a wrong url (I don't know if this is a good or bad thing for a test)
and this… | |||||
Done Inline ActionsIt should be a valid URI in practice; but in tests it doesn't really matter. Changed to a more obvious url. vlorentz: It should be a valid URI in practice; but in tests it doesn't really matter. Changed to a more… | |||||
"url": "http:///hal/inria", | |||||
"metadata": {"location": "France"}, | "metadata": {"location": "France"}, | ||||
} | } | ||||
metadata_authority2 = { | |||||
"type": "registry", | |||||
"url": "http://wikidata.example.com/", | |||||
"metadata": {}, | |||||
} | |||||
metadata_tool = { | metadata_fetcher = { | ||||
"name": "swh-deposit", | "name": "swh-deposit", | ||||
"version": "0.0.1", | "version": "0.0.1", | ||||
"configuration": {"sword_version": "2"}, | "metadata": {"sword_version": "2"}, | ||||
} | |||||
metadata_fetcher2 = { | |||||
"name": "swh-example", | |||||
"version": "0.0.1", | |||||
"metadata": {}, | |||||
} | } | ||||
date_visit1 = datetime.datetime(2015, 1, 1, 23, 0, 0, tzinfo=datetime.timezone.utc) | date_visit1 = datetime.datetime(2015, 1, 1, 23, 0, 0, tzinfo=datetime.timezone.utc) | ||||
type_visit1 = "git" | type_visit1 = "git" | ||||
date_visit2 = datetime.datetime(2017, 1, 1, 23, 0, 0, tzinfo=datetime.timezone.utc) | date_visit2 = datetime.datetime(2017, 1, 1, 23, 0, 0, tzinfo=datetime.timezone.utc) | ||||
type_visit2 = "hg" | type_visit2 = "hg" | ||||
▲ Show 20 Lines • Show All 103 Lines • ▼ Show 20 Lines | "branches": { | ||||
"target": hash_to_bytes("1a8893e6a86f444e8be8e7bda6cb34fb1735a00e"), | "target": hash_to_bytes("1a8893e6a86f444e8be8e7bda6cb34fb1735a00e"), | ||||
"target_type": "snapshot", | "target_type": "snapshot", | ||||
}, | }, | ||||
b"dangling": None, | b"dangling": None, | ||||
}, | }, | ||||
} | } | ||||
origin_metadata = { | origin_metadata = { | ||||
"origin": origin, | "origin_url": origin["url"], | ||||
"discovery_date": datetime.datetime( | "discovery_date": datetime.datetime( | ||||
2015, 1, 1, 23, 0, 0, tzinfo=datetime.timezone.utc | 2015, 1, 1, 23, 0, 0, tzinfo=datetime.timezone.utc | ||||
), | ), | ||||
"provider": provider, | "authority": { | ||||
"tool": "swh-deposit", | "type": metadata_authority["type"], | ||||
"metadata": {"name": "test_origin_metadata", "version": "0.0.1"}, | "url": metadata_authority["url"], | ||||
}, | |||||
"fetcher": { | |||||
"name": metadata_fetcher["name"], | |||||
"version": metadata_fetcher["version"], | |||||
}, | |||||
"format": "json", | |||||
"metadata": b'{"foo": "bar"}', | |||||
} | } | ||||
origin_metadata2 = { | origin_metadata2 = { | ||||
"origin": origin, | "origin_url": origin["url"], | ||||
"discovery_date": datetime.datetime( | |||||
2017, 1, 1, 23, 0, 0, tzinfo=datetime.timezone.utc | |||||
), | |||||
"authority": { | |||||
"type": metadata_authority["type"], | |||||
"url": metadata_authority["url"], | |||||
}, | |||||
"fetcher": { | |||||
"name": metadata_fetcher["name"], | |||||
"version": metadata_fetcher["version"], | |||||
}, | |||||
"format": "yaml", | |||||
"metadata": b"foo: bar", | |||||
} | |||||
origin_metadata3 = { | |||||
"origin_url": origin["url"], | |||||
"discovery_date": datetime.datetime( | "discovery_date": datetime.datetime( | ||||
2017, 1, 1, 23, 0, 0, tzinfo=datetime.timezone.utc | 2017, 1, 1, 23, 0, 0, tzinfo=datetime.timezone.utc | ||||
), | ), | ||||
"provider": provider, | "authority": { | ||||
"tool": "swh-deposit", | "type": metadata_authority2["type"], | ||||
"metadata": {"name": "test_origin_metadata", "version": "0.0.1"}, | "url": metadata_authority2["url"], | ||||
}, | |||||
"fetcher": { | |||||
"name": metadata_fetcher2["name"], | |||||
"version": metadata_fetcher2["version"], | |||||
}, | |||||
"format": "yaml", | |||||
"metadata": b"foo: bar", | |||||
} | } | ||||
person = { | person = { | ||||
"name": b"John Doe", | "name": b"John Doe", | ||||
"email": b"john.doe@institute.org", | "email": b"john.doe@institute.org", | ||||
"fullname": b"John Doe <john.doe@institute.org>", | "fullname": b"John Doe <john.doe@institute.org>", | ||||
} | } |
above the type is only deposit