Loading lib/galaxy/managers/histories.py +2 −2 Original line number Diff line number Diff line Loading @@ -469,9 +469,9 @@ class HistorySerializer(sharable.SharableModelSerializer, deletable.PurgableSeri 'nice_size': lambda item, key, **context: item.disk_nice_size, 'state': self.serialize_history_state, 'url': lambda item, key, **context: self.url_for('history', id=self.app.security.encode_id(item.id)), 'url': lambda item, key, **context: self.url_for('history', id=self.app.security.encode_id(item.id), context=context), 'contents_url': lambda item, key, **context: self.url_for('history_contents', history_id=self.app.security.encode_id(item.id)), history_id=self.app.security.encode_id(item.id), context=context), 'empty': lambda item, key, **context: (len(item.datasets) + len(item.dataset_collections)) <= 0, 'count': lambda item, key, **context: len(item.datasets), Loading lib/galaxy/webapps/galaxy/api/histories.py +1 −0 Original line number Diff line number Diff line Loading @@ -188,6 +188,7 @@ class FastAPIHistories: @router.get( '/api/histories/{id}', name="history", summary='Returns the history with the given ID.', ) def show( Loading lib/galaxy_test/api/test_histories.py +9 −0 Original line number Diff line number Diff line Loading @@ -77,6 +77,15 @@ class HistoriesApiTestCase(ApiTestCase, BaseHistories): self._assert_has_keys(state_details, *states) self._assert_has_keys(state_ids, *states) def test_show_history_returns_expected_urls(self): # This test can be dropped when the URL attributes become deprecated history_id = self._create_history("TestHistoryForUrls")["id"] show_response = self._show(history_id) self._assert_has_key(show_response, 'id', 'url', 'contents_url') assert show_response["url"] == f"/api/histories/{history_id}" assert show_response["contents_url"] == f"/api/histories/{history_id}/contents" def test_show_most_recently_used(self): history_id = self._create_history("TestHistoryRecent")["id"] show_response = self._get("histories/most_recently_used").json() Loading Loading
lib/galaxy/managers/histories.py +2 −2 Original line number Diff line number Diff line Loading @@ -469,9 +469,9 @@ class HistorySerializer(sharable.SharableModelSerializer, deletable.PurgableSeri 'nice_size': lambda item, key, **context: item.disk_nice_size, 'state': self.serialize_history_state, 'url': lambda item, key, **context: self.url_for('history', id=self.app.security.encode_id(item.id)), 'url': lambda item, key, **context: self.url_for('history', id=self.app.security.encode_id(item.id), context=context), 'contents_url': lambda item, key, **context: self.url_for('history_contents', history_id=self.app.security.encode_id(item.id)), history_id=self.app.security.encode_id(item.id), context=context), 'empty': lambda item, key, **context: (len(item.datasets) + len(item.dataset_collections)) <= 0, 'count': lambda item, key, **context: len(item.datasets), Loading
lib/galaxy/webapps/galaxy/api/histories.py +1 −0 Original line number Diff line number Diff line Loading @@ -188,6 +188,7 @@ class FastAPIHistories: @router.get( '/api/histories/{id}', name="history", summary='Returns the history with the given ID.', ) def show( Loading
lib/galaxy_test/api/test_histories.py +9 −0 Original line number Diff line number Diff line Loading @@ -77,6 +77,15 @@ class HistoriesApiTestCase(ApiTestCase, BaseHistories): self._assert_has_keys(state_details, *states) self._assert_has_keys(state_ids, *states) def test_show_history_returns_expected_urls(self): # This test can be dropped when the URL attributes become deprecated history_id = self._create_history("TestHistoryForUrls")["id"] show_response = self._show(history_id) self._assert_has_key(show_response, 'id', 'url', 'contents_url') assert show_response["url"] == f"/api/histories/{history_id}" assert show_response["contents_url"] == f"/api/histories/{history_id}/contents" def test_show_most_recently_used(self): history_id = self._create_history("TestHistoryRecent")["id"] show_response = self._get("histories/most_recently_used").json() Loading