@pytest.fixture
def mock_response_single_catalog(requests_mock):
requests_mock.get(
url="https://metax-v2-test/rest/datacatalogs/urn:nbn:fi:att:data-catalog-ida",
json=get_mock_data("legacy_single_catalog_response.json"),
)
requests_mock.get(
url="https://metax-v2-test/rest/v2/datasets?data_catalog=urn:nbn:fi:att:data-catalog-ida&removed=false",
json={
"count": 1,
"next": None,
"results": [get_mock_data("legacy_single_response.json")],
},
)
requests_mock.get(
url="https://metax-v2-test/rest/v2/datasets?data_catalog=urn:nbn:fi:att:data-catalog-ida&removed=true",
json={
"count": 0,
"next": None,
"results": [],
},
)
requests_mock.get(
url="https://metax-v2-test/rest/v2/datasets/c955e904-e3dd-4d7e-99f1-3fed446f96d1/files",
json=get_mock_data("legacy_single_response_files.json"),
)
requests_mock.get(
url="https://metax-v2-test/rest/v2/datasets/c955e904-e3dd-4d7e-99f1-3fed446f96d1/files?id_list=true",
json=get_mock_data("legacy_single_response_file_ids.json"),
)
requests_mock.get(
url="https://metax-v2-test/rest/datacatalogs/unknown_catalog",
status_code=404,
)