Skip to content

Commit

Permalink
feat: 88 add dataset_id to the metadata endpoint (#93)
Browse files Browse the repository at this point in the history
Co-authored-by: Timmy Huang <[email protected]>
  • Loading branch information
ebezzi and tihuan authored Sep 30, 2021
1 parent 24d7b63 commit ae60d1b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions server/data_common/dataset_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ def get_dataset_and_collection_metadata(dataset_explorer_location: str, app_conf

metadata = {
"dataset_name": [dataset["name"] for dataset in res["datasets"] if dataset["id"] == dataset_id][0],
"dataset_id": dataset_id,
"collection_url": f"{web_base_url}/collections/{collection_id}{suffix}",
"collection_name": res["name"],
"collection_description": res["description"],
Expand Down
1 change: 1 addition & 0 deletions server/tests/unit/common/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -805,6 +805,7 @@ def test_dataset_metadata_api_called(self, mock_get, mock_dp):
self.assertEqual(response_obj["dataset_name"], "Test Dataset")

expected_url = f"https://cellxgene.staging.single-cell.czi.technology/collections/{response_body['id']}"
self.assertEqual(response_obj["dataset_id"], response_body["datasets"][0]["id"])
self.assertEqual(response_obj["collection_url"], expected_url)
self.assertEqual(response_obj["collection_name"], response_body["name"])
self.assertEqual(response_obj["collection_contact_email"], response_body["contact_email"])
Expand Down

0 comments on commit ae60d1b

Please sign in to comment.