Changeset View
Changeset View
Standalone View
Standalone View
swh/deposit/tests/conftest.py
Show First 20 Lines • Show All 580 Lines • ▼ Show 20 Lines | deposit = create_deposit( | ||||
authenticated_client, | authenticated_client, | ||||
deposit_collection.name, | deposit_collection.name, | ||||
sample_archive, | sample_archive, | ||||
external_id="external-id-complete", | external_id="external-id-complete", | ||||
deposit_status=DEPOSIT_STATUS_LOAD_SUCCESS, | deposit_status=DEPOSIT_STATUS_LOAD_SUCCESS, | ||||
) | ) | ||||
origin = "https://hal.archives-ouvertes.fr/hal-01727745" | origin = "https://hal.archives-ouvertes.fr/hal-01727745" | ||||
directory_id = "42a13fc721c8716ff695d0d62fc851d641f3a12b" | directory_id = "42a13fc721c8716ff695d0d62fc851d641f3a12b" | ||||
revision_id = hash_to_bytes("548b3c0a2bb43e1fca191e24b5803ff6b3bc7c10") | release_id = hash_to_bytes("548b3c0a2bb43e1fca191e24b5803ff6b3bc7c10") | ||||
snapshot_id = hash_to_bytes("e5e82d064a9c3df7464223042e0c55d72ccff7f0") | snapshot_id = hash_to_bytes("e5e82d064a9c3df7464223042e0c55d72ccff7f0") | ||||
deposit.swhid = f"swh:1:dir:{directory_id}" | deposit.swhid = f"swh:1:dir:{directory_id}" | ||||
deposit.swhid_context = str( | deposit.swhid_context = str( | ||||
QualifiedSWHID( | QualifiedSWHID( | ||||
object_type=ObjectType.DIRECTORY, | object_type=ObjectType.DIRECTORY, | ||||
object_id=hash_to_bytes(directory_id), | object_id=hash_to_bytes(directory_id), | ||||
origin=origin, | origin=origin, | ||||
visit=CoreSWHID(object_type=ObjectType.SNAPSHOT, object_id=snapshot_id), | visit=CoreSWHID(object_type=ObjectType.SNAPSHOT, object_id=snapshot_id), | ||||
anchor=CoreSWHID(object_type=ObjectType.REVISION, object_id=revision_id), | anchor=CoreSWHID(object_type=ObjectType.RELEASE, object_id=release_id), | ||||
path=b"/", | path=b"/", | ||||
) | ) | ||||
) | ) | ||||
deposit.save() | deposit.save() | ||||
return deposit | return deposit | ||||
@pytest.fixture() | @pytest.fixture() | ||||
def tmp_path(tmp_path): | def tmp_path(tmp_path): | ||||
return str(tmp_path) # issue with oldstable's pytest version | return str(tmp_path) # issue with oldstable's pytest version |