def METHOD_NAME(self, client, server_config, more_datasets, pbench_drb_token):
    """
    Helper fixture to perform the API query and validate an expected
    return status.
    Args:
        client: Flask test API client fixture
        server_config: Pbench config fixture
        more_datasets: Dataset construction fixture
        pbench_drb_token: Authenticated user token fixture
    """
    def query_api(
        dataset: str, target: str, expected_status: HTTPStatus
    ) -> requests.Response:
        try:
            dataset_id = Dataset.query(name=dataset).resource_id
        except DatasetNotFound:
            dataset_id = dataset  # Allow passing deliberately bad value
        headers = {"authorization": f"bearer {pbench_drb_token}"}
        response = client.get(
            f"{server_config.rest_uri}/datasets/{dataset_id}/inventory/{target}",
            headers=headers,
        )
        assert response.status_code == expected_status
        return response
    return query_api