Warning
This document is for an in-development version of Galaxy. You can alternatively view this page in the latest release if it exists or view the top of the latest release's documentation.
galaxy_test.api package
Subpackages
Submodules
galaxy_test.api.sharable module
- class galaxy_test.api.sharable.SharingApiTests[source]
Bases:
UsesApiTestCaseMixinIncludes some tests for the sharing functionality of a particular resource type.
galaxy_test.api.test_authenticate module
galaxy_test.api.test_configuration module
galaxy_test.api.test_dataset_collections module
- class galaxy_test.api.test_dataset_collections.TestDatasetCollectionsApi[source]
Bases:
ApiTestCase- dataset_populator: DatasetPopulator
- test_sample_sheet_map_over_preserves_columns(history_id)[source]
Test that mapping cat1 over a sample sheet preserves columns metadata.
- galaxy_test.api.test_dataset_collections.upload_flat_sample_sheet(dataset_populator: DatasetPopulator)[source]
- galaxy_test.api.test_dataset_collections.assert_one_collection_created_in_history(dataset_populator: DatasetPopulator, history_id: str)[source]
galaxy_test.api.test_datasets module
galaxy_test.api.test_datatypes module
galaxy_test.api.test_display_applications module
- class galaxy_test.api.test_display_applications.TestDisplayApplicationsApi[source]
Bases:
ApiTestCase- dataset_populator: DatasetPopulator
galaxy_test.api.test_folder_contents module
- class galaxy_test.api.test_folder_contents.TestFolderContentsApi[source]
Bases:
ApiTestCase- dataset_populator: DatasetPopulator
galaxy_test.api.test_folders module
- class galaxy_test.api.test_folders.TestFoldersApi[source]
Bases:
ApiTestCase- dataset_populator: DatasetPopulator
galaxy_test.api.test_framework module
galaxy_test.api.test_group_roles module
- class galaxy_test.api.test_group_roles.TestGroupRolesApi[source]
Bases:
ApiTestCase- dataset_populator: DatasetPopulator
galaxy_test.api.test_group_users module
- class galaxy_test.api.test_group_users.TestGroupUsersApi[source]
Bases:
ApiTestCase- dataset_populator: DatasetPopulator
galaxy_test.api.test_groups module
galaxy_test.api.test_histories module
- class galaxy_test.api.test_histories.TestHistoriesApi[source]
Bases:
ApiTestCase,BaseHistories
- class galaxy_test.api.test_histories.ImportExportTests[source]
Bases:
BaseHistories
- class galaxy_test.api.test_histories.TestImportExportHistory[source]
Bases:
ApiTestCase,ImportExportTests
- class galaxy_test.api.test_histories.TestSharingHistory[source]
Bases:
ApiTestCase,BaseHistories,SharingApiTestsTests specific for the particularities of sharing Histories.
- class galaxy_test.api.test_histories.TestArchivingHistoriesWithoutExportRecord[source]
Bases:
ApiTestCase,BaseHistories
- class galaxy_test.api.test_histories.TestHistoryGraphApi[source]
Bases:
ApiTestCase,BaseHistoriesAPI-level tests for
GET /api/histories/{id}/graph.These cover the surface the endpoint owns: status codes, query parameter validation, auth boundaries, and response shape. Builder logic is exercised separately in
test_HistoryGraphBuilder.
galaxy_test.api.test_history_contents module
- class galaxy_test.api.test_history_contents.TestHistoryContentsApi[source]
Bases:
ApiTestCase- dataset_populator: DatasetPopulator
- test_index_filter_by_name_unique_sentinel(history_id)[source]
Real-DB integration coverage for
History.paginated_active_visible_datasetsname-search path — a unique sentinel name must return exactly one HDA (no substring leakage).
- test_index_filter_by_hid_exact(history_id)[source]
q=hid-eqreturns the HDA with the requested hid — covers the numeric branch ofpaginated_active_visible_datasets.search.
- test_index_filter_collections_by_extension_nested(history_id)[source]
Depth-arbitrary regression test for the
extensionHDCA filter (recursive CTE inHistory._hdca_leaf_hda_descendants_cte). Alist:pairedcollection nests one level deeper than a flat list — verify the recursive walk still catches non-matching leaves.
galaxy_test.api.test_history_contents_provenance module
galaxy_test.api.test_jobs module
- class galaxy_test.api.test_jobs.TestJobsApi[source]
Bases:
ApiTestCase,TestsTools- dataset_populator: DatasetPopulator
- test_job_build_for_rerun_hdca_value_in_options(history_id)[source]
When rerunning a job whose input was a collection passed to a
multiple="true"data parameter, the collection must appear inoptions.hdca(notoptions.hda) so the client can match it against the value’ssrc: "hdca".Regression test for a bug where hidden HDCAs were misclassified as HDAs in the fallback options, causing the rerun form to show single- dataset mode with nothing pre-selected.
galaxy_test.api.test_libraries module
- class galaxy_test.api.test_libraries.TestLibrariesApi[source]
Bases:
ApiTestCase- dataset_populator: DatasetPopulator
galaxy_test.api.test_licenses module
galaxy_test.api.test_page_revisions module
galaxy_test.api.test_pages module
- class galaxy_test.api.test_pages.BasePagesApiTestCase[source]
Bases:
ApiTestCase- dataset_populator: DatasetPopulator
- class galaxy_test.api.test_pages.TestPagesApi[source]
Bases:
BasePagesApiTestCase,SharingApiTests- create(name: str) str[source]
Creates a shareable resource with the given name and returns it’s ID.
- Parameters:
name – The name of the shareable resource to create.
- Returns:
The ID of the resource.
galaxy_test.api.test_roles module
- class galaxy_test.api.test_roles.TestRolesApi[source]
Bases:
ApiTestCase- dataset_populator: DatasetPopulator
galaxy_test.api.test_search module
galaxy_test.api.test_tool_data module
Tests for the tool data API.
The tests for the DELETE endpoint can be found in the integration tests directory (tests/integration/test_tool_data_delete.py) since these tests can mutate the server config state.
galaxy_test.api.test_tools module
- class galaxy_test.api.test_tools.TestsTools[source]
Bases:
object- dataset_populator: DatasetPopulator
- dataset_collection_populator: BaseDatasetCollectionPopulator
- class galaxy_test.api.test_tools.TestToolsApi[source]
Bases:
ApiTestCase,TestsTools- dataset_populator: DatasetPopulator
- test_build_data_options_default_page()[source]
Default response caps data parameter options at 50 per src and emits
options_metaso the client can detect more pages exist.
- test_build_data_options_pagination_offset()[source]
options_paginationreturns the requested slice.
- test_build_data_options_pinned_outside_page()[source]
Selected HDA outside the page window appears in
pinned.
- test_build_data_options_search_by_name()[source]
options_pagination[...].searchfilters HDAs by name (ilike) before pagination, so users can find datasets outside the default page window by typing into the dropdown.
- test_build_data_options_search_by_hid()[source]
A numeric
searchvalue also matches the HDA’s hid, so typing1surfaces hid=1 even when it’s outside the default page window.
- test_build_collection_options_interleaves_direct_and_multirun_by_hid()[source]
Direct matches (
pairedcollections) and multirun matches (list:pairedcollections that can be mapped over to feed a paired param) must be returned merged in HID-desc order — the legacy pre-pagination behavior was tosorted([direct + multirun], reverse=True). Multirun entries must carry amap_over_typewhile direct entries must not.
- test_build_collection_options_pagination_preserves_interleaved_order()[source]
Pagination must return contiguous slices of the same merged HID-desc ordering: page 0 + page 1 reconstruct the unpaginated list without losing or reshuffling either kind across the page boundary.
A hidden
pairedcollection still appears under direct match — preserves legacyactive_dataset_collectionssemantics (which included hidden) for the direct-match path.
A hidden
list:pairedcollection must NOT appear as a multirun match — preserves legacyactive_visible_dataset_collectionssemantics (visible-only) for the subcollection-mapping path.
- test_build_collection_options_multi_typed_emits_direct_and_multirun()[source]
Pinned against release_26.0 (pre-pagination): a parameter that accepts multiple collection types (
list,list:list) given a singlelist:listHDCA must emit two dropdown entries with the same HID — one direct (nomap_over_type) and one multirun (map_over_type="list") — becausedirect_matchandcan_map_overare not mutually exclusive across the CTD list.
- test_build_collection_options_unmappable_excluded()[source]
A plain
listcollection neither directly matches apairedparam nor can be mapped over to one, so it must not appear.
- test_tool_schema_metadata()[source]
Test that tool parameter JSON schemas include Galaxy metadata attributes.
- test_job_cache_copy_collection()[source]
Test job caching when collection_creates_list_2 is run with renamed dataset input.
This tests the scenario where: - A tool has both a dataset input and a collection input - The tool outputs a flat list (HDA elements) with structured_like - The dataset input is renamed between runs - Early caching misses due to name mismatch - Late caching (require_name_match=False) finds a match - copy_from_job is called during job preparation
This triggers https://github.com/galaxyproject/galaxy/issues/21556
- class galaxy_test.api.test_tools.TestDataManagerToolsApi[source]
Bases:
ApiTestCase,TestsToolsAPI tests that need the test case to act as an admin (e.g. data managers).
- require_admin_user = True
- dataset_populator: DatasetPopulator
galaxy_test.api.test_tools_upload module
- class galaxy_test.api.test_tools_upload.TestToolsUpload[source]
Bases:
ApiTestCase- dataset_populator: DatasetPopulator
galaxy_test.api.test_tours module
galaxy_test.api.test_users module
galaxy_test.api.test_visualizations module
- class galaxy_test.api.test_visualizations.TestVisualizationsApi[source]
Bases:
ApiTestCase,SharingApiTests
galaxy_test.api.test_webhooks module
galaxy_test.api.test_workflow_extraction module
- class galaxy_test.api.test_workflow_extraction.TestWorkflowExtractionApi[source]
Bases:
_ExtractionHelpersMixin,BaseWorkflowsApiTestCase,WorkflowStructureAssertions
- class galaxy_test.api.test_workflow_extraction.TestWorkflowExtractionByIdsApi[source]
Bases:
_ExtractionHelpersMixin,BaseWorkflowsApiTestCase,WorkflowStructureAssertionsTests for POST /api/workflows/extract (ID-based extraction).
Sibling of
TestWorkflowExtractionApi— same scenarios, but the payload carries encoded HDA / HDCA / job ids rather than HIDs, and the request goes to the new history-optional endpoint.- test_subcollection_mapping_by_ids(history_id)[source]
ID-path equivalent of HID test_subcollection_mapping. Exercises a tool consuming a paired sub-collection element of a list:paired; wiring goes through find_implicit_input_collection so the workflow sees a single list:paired input rather than per-job leaves.
- test_extract_with_copied_inputs_post_copy_ids(history_id)[source]
User passes post-copy HDA ids (in extraction history) plus the original (pre-copy) job id.
- test_extract_with_copied_inputs_pre_copy_ids(history_id)[source]
User passes pre-copy HDA ids (in original history) plus the original job id; copies exist in history_id but are not referenced. Cross-history extraction — no history context supplied or required.
- test_job_with_icj_via_job_ids_rejected(history_id)[source]
A constituent job of an implicit collection map must not be passed as a plain job_id - the caller must use implicit_collection_jobs_ids so the server can treat the whole map as one step.
- test_mixed_icj_and_member_job_rejected(history_id)[source]
Passing both an ICJ and one of its constituent jobs is rejected - the validator that filters job_ids fires first because the member job carries an ICJ association.
- test_inaccessible_dataset_rejected(history_id)[source]
Another user’s private HDA in payload should be rejected.
- test_inaccessible_collection_rejected(history_id)[source]
Another user’s private HDCA in payload should be rejected.
- test_extract_dce_as_data_param_flows_through_as_leaf_hda(history_id)[source]
A tool job whose DataToolParameter was fed a DCE (drag-and-dropped collection element) should resolve its connection via the leaf HDA’s id — the workflow has no DCE/HDCA reference. User passes the leaf HDA id in hda_ids.
- test_extract_after_copy_no_foreign_jobs(history_id)[source]
Regression for #9161: dataset copied A->B, tool run in B, extract from B. With ID-based extraction the user explicitly supplies the B-side job; result must not reference the A-side dataset’s HDA id.
- test_extract_with_cached_job_cross_history(history_id)[source]
Run cat1 in history A, then in B with use_cached_job=True. Extract from B with hda_ids/job_ids referring to B-side rows. Workflow should wire B-side input to B-side cached job, not pull A-side rows in.
- test_roundtrip_basic_by_ids(history_id)[source]
Extract a cat1 workflow via the by-ids endpoint, invoke it on a fresh history, and assert it produces an output.
- test_extract_by_ids_input_order_equivalent(history_id)[source]
Same hda_ids in different order produce structurally equivalent workflows. Canvas layout via order_workflow_steps_with_levels may differ across input orderings, but step types, tool set, and connection topology must match.
- test_extract_distinct_outputs_with_duplicate_label_string_rejected(history_id)[source]
Two distinct outputs cannot share the same workflow output label (duplicate-label-string guard in WorkflowsService._validate_extract_by_ids_payload). Sibling of the same-id duplicate guard which the existing duplicate test pins.
- test_extract_output_label_for_icj_step(history_id)[source]
ICJ producer: labelling the mapped output HDCA of a map-over step must attach the workflow_output to the tool step, keyed by the implicit collection output name.
- test_extract_output_label_orphan_rejected(history_id)[source]
Labelling an HDA that was not produced by any selected step must be rejected with a 400. Hits the orphan guard in WorkflowsService._validate_extract_by_ids_payload (the inner guard in extract_steps is dead for the API path because the service layer fires first).
- class galaxy_test.api.test_workflow_extraction.TestWorkflowExtractionSummaryApi[source]
Bases:
_ExtractionHelpersMixin,BaseWorkflowsApiTestCaseTests for GET /api/histories/{history_id}/extraction_summary.
- test_extraction_summary_suggested_name_source_per_producer_kind()[source]
Per-kind dispatch (HDA path vs HDCA path in workflow_extraction_naming): rename the cat1 HDA so its source is ‘renamed’ and its suggested_name reflects the rename. The mapped ICJ HDCA — never renamed by us — must surface its own auto-generated HDCA name, distinct from the cat1 rename. A regression that hard-codes a single source token or returns the same name for both producer kinds fails this test.
galaxy_test.api.test_workflows module
- class galaxy_test.api.test_workflows.RunsWorkflowFixtures[source]
Bases:
object- workflow_populator: WorkflowPopulator
- class galaxy_test.api.test_workflows.BaseWorkflowsApiTestCase[source]
Bases:
ApiTestCase,RunsWorkflowFixtures- dataset_populator: DatasetPopulator
- class galaxy_test.api.test_workflows.ChangeDatatypeTests[source]
Bases:
object- dataset_populator: DatasetPopulator
- workflow_populator: WorkflowPopulator
- class galaxy_test.api.test_workflows.TestWorkflowSharingApi[source]
Bases:
ApiTestCase,SharingApiTests
- class galaxy_test.api.test_workflows.TestWorkflowsApi[source]
Bases:
BaseWorkflowsApiTestCase,ChangeDatatypeTests- dataset_populator: DatasetPopulator
- test_download_workflow_with_missing_file_source()[source]
Test that workflows referencing non-existent file sources can be downloaded.
Regression test for https://github.com/galaxyproject/galaxy/issues/21732. When a file source referenced in a workflow is removed from the server configuration, users should still be able to download the workflow for viewing and editing.
- test_refactor_specific_version()[source]
Test that refactoring can target a specific workflow version.
- test_wrong_current_case_ignored_on_execution()[source]
Prove __current_case__ is redundant: set it wrong, assert output follows test param.
- test_missing_current_case_recomputed_on_execution()[source]
Prove __current_case__ can be absent — Galaxy recomputes it from the test param.
- test_import_ga_workflow_with_url_subworkflow()[source]
Test importing a .ga workflow where a subworkflow is referenced via a base64:// URL.
- test_import_gxformat2_workflow_with_url_subworkflow()[source]
Test importing a gxformat2 workflow where a subworkflow is referenced via a base64:// URL.
- test_import_ga_workflow_with_trs_url_subworkflow()[source]
Test importing a .ga workflow where a subworkflow is referenced via a TRS URL.
- test_import_ga_workflow_with_trs_id_subworkflow()[source]
Test importing a .ga workflow where a subworkflow is referenced via TRS server + tool ID + version.
- test_download_preserves_url_subworkflow_link()[source]
Test that downloading with preserve_external_subworkflow_links emits content_source/content_id.
- test_modified_subworkflow_not_preserved_as_link()[source]
After updating a subworkflow the external link is lost and content is embedded verbatim.
- test_roundtrip_ga_workflow_with_url_subworkflow()[source]
Import .ga with URL subworkflow, download with preserved links, re-import, verify.
- test_roundtrip_format2_workflow_with_url_subworkflow()[source]
Import gxformat2 with URL subworkflow, download format2 with preserved links, re-import, verify.
- run_workflow_with_valid_hashes(history_id: str, content_1: str, content_2: str, use_cached_job: bool = False)[source]
- test_pick_value_first_non_null_ordering()[source]
Verify first_non_null picks input_0 over input_1 when both are non-null.
- test_pick_value_first_non_null_ordering_skipped_first()[source]
Verify first_non_null skips null input_0 and picks input_1.
- test_run_workflow_conditional_subworkflow_step_map_over_expression_tool_with_extra_nesting()[source]
- test_run_workflow_conditional_subworkflow_step_map_over_expression_tool_with_extra_nesting_skip_all()[source]
- test_workflow_invocation_report_invalid_hdca_id()[source]
Test that an invalid HDCA id is reported in errors.
- test_reimport_invocation_with_files()[source]
Test that reimporting an invocation with include_files=True preserves dataset state and content.
- test_export_invocation_ro_crate_with_subworkflow()[source]
Test that subworkflow invocation datasets are included in export.
- test_export_reimport_reexport_invocation_with_subworkflow()[source]
Test that subworkflow invocation data survives a round-trip export/import/export cycle.
- test_run_subworkflow_with_required_input_with_default_unconnected()[source]
Test subworkflow with required parameter input that has default value but is unconnected.
This test verifies that a subworkflow can run successfully when: 1. Parent workflow has a subworkflow step 2. Subworkflow has a parameter input with:
optional: false (required)
default: “default_value”
The parameter input is NOT connected from parent workflow
The default value should be used automatically
Before the fix, this would fail with “Subworkflow has disconnected required input.” After the fix, the workflow runs successfully using the default value.
- test_subworkflow_validation_error_step_path()[source]
Test that validation errors from subworkflows include the full step path.
- test_invocation_job_metrics_with_subworkflow()[source]
Test that subworkflow job metrics are included in parent invocation metrics.
- test_workflow_with_deleted_dataset_step_parameter()[source]
Verify workflow fails gracefully when a step parameter references a deleted dataset.
Uses a pause step so we can delete the dataset after the invocation is queued but before the cat step executes, avoiding a race condition.
- test_run_subworkflow_with_optional_parent_input_connected_but_not_provided()[source]
Test subworkflow when parent’s optional input is connected but not provided.
This test verifies the fix for a bug where: 1. Parent workflow has an OPTIONAL input 2. That optional input IS CONNECTED to the subworkflow’s input 3. But NO DATA is provided for the parent’s optional input 4. Subworkflow has DELAYED SCHEDULING (via $link)
After the fix, the parent’s optional input outputs are pre-populated with NO_REPLACEMENT before the subworkflow executes, allowing it to properly handle the missing value.
This is different from the case where subworkflow inputs are completely unconnected, which was fixed in 2022.
- test_run_subworkflow_with_boolean_parameter_in_when_condition()[source]
Test boolean false parameter passed to subworkflow with when condition.
This test verifies that boolean parameters (especially false) are properly passed from parent to subworkflow when the subworkflow has: 1. Delayed scheduling (via $link) 2. A when condition that uses the boolean parameter
Previously, false values were converted to None in the when expression evaluation, causing “when_not_boolean” errors.
- test_copy_inputs_to_history_with_tags()[source]
Test that tags are copied when workflow inputs are copied to a new history.
Test that pick_value output doesn’t inherit hidden state from inputs.
- class galaxy_test.api.test_workflows.TestAdminWorkflowsApi[source]
Bases:
BaseWorkflowsApiTestCase- require_admin_user = True
- class galaxy_test.api.test_workflows.TestCachedWorkflowsApi[source]
Bases:
BaseWorkflowsApiTestCase,ChangeDatatypeTests- dataset_populator: DatasetPopulator
galaxy_test.api.test_workflows_cwl module
Test CWL workflow functionality.
galaxy_test.api.test_workflows_from_yaml module
- class galaxy_test.api.test_workflows_from_yaml.TestWorkflowsFromYamlApi[source]
Bases:
BaseWorkflowsApiTestCase