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.

tool_shed.test.base package

Submodules

tool_shed.test.base.common module

tool_shed.test.base.test_db_util module

tool_shed.test.base.test_db_util.sa_session()[source]
tool_shed.test.base.test_db_util.install_session()[source]
tool_shed.test.base.test_db_util.flush(obj)[source]
tool_shed.test.base.test_db_util.get_all_repositories()[source]
tool_shed.test.base.test_db_util.get_all_installed_repositories(session=None) List[ToolShedRepository][source]
tool_shed.test.base.test_db_util.get_installed_repository_by_id(repository_id)[source]
tool_shed.test.base.test_db_util.get_installed_repository_by_name_owner(repository_name, owner, return_multiple=False, session=None)[source]
tool_shed.test.base.test_db_util.get_role(user, role_name)[source]
tool_shed.test.base.test_db_util.get_repository_role_association(repository_id, role_id)[source]
tool_shed.test.base.test_db_util.get_repository_by_id(repository_id)[source]
tool_shed.test.base.test_db_util.get_user(email)[source]
tool_shed.test.base.test_db_util.refresh(obj)[source]
tool_shed.test.base.test_db_util.ga_refresh(obj)[source]
tool_shed.test.base.test_db_util.get_repository_by_name_and_owner(name, owner_username, return_multiple=False)[source]
tool_shed.test.base.test_db_util.get_repository_metadata_by_repository_id_changeset_revision(repository_id, changeset_revision)[source]

tool_shed.test.base.twilltestcase module

class tool_shed.test.base.twilltestcase.ToolShedInstallationClient[source]

Bases: object

abstract check_galaxy_repository_tool_panel_section(repository: ToolShedRepository, expected_tool_panel_section: str) None[source]
abstract setup() None[source]

Setup client interaction.

abstract deactivate_repository(installed_repository: ToolShedRepository) None[source]

Deactivate the supplied repository.

abstract display_installed_jobs_list_page(installed_repository: ToolShedRepository, data_manager_names=None, strings_displayed=None) None[source]

If available, check data manager jobs for supplied strings.

abstract installed_repository_extended_info(installed_repository: ToolShedRepository) Dict[str, Any][source]
abstract install_repository(name: str, owner: str, changeset_revision: str, install_tool_dependencies: bool, install_repository_dependencies: bool, new_tool_panel_section_label: str | None) None[source]
abstract reactivate_repository(installed_repository: ToolShedRepository) None[source]
abstract reset_metadata_on_installed_repositories(repositories: List[ToolShedRepository]) None[source]
abstract reset_installed_repository_metadata(repository: ToolShedRepository) None[source]
abstract uninstall_repository(installed_repository: ToolShedRepository) None[source]
abstract update_installed_repository(installed_repository: ToolShedRepository, verify_no_updates: bool = False) Dict[str, Any][source]
abstract property tool_data_path: str
abstract property shed_tool_data_table_conf: str
abstract get_tool_names() List[str][source]
abstract get_installed_repository_by_name_owner(repository_name: str, repository_owner: str) ToolShedRepository[source]
abstract get_installed_repositories_by_name_owner(repository_name: str, repository_owner: str) List[ToolShedRepository][source]
abstract get_installed_repository_for(owner: str | None = None, name: str | None = None, changeset: str | None = None) Dict[str, Any] | None[source]
abstract get_all_installed_repositories() List[ToolShedRepository][source]
abstract refresh_tool_shed_repository(repo: ToolShedRepository) None[source]
class tool_shed.test.base.twilltestcase.GalaxyInteractorToolShedInstallationClient(testcase)[source]

Bases: ToolShedInstallationClient

A Galaxy API + Database as a installation target for the tool shed.

__init__(testcase)[source]
setup()[source]

Setup client interaction.

check_galaxy_repository_tool_panel_section(repository: ToolShedRepository, expected_tool_panel_section: str) None[source]
deactivate_repository(installed_repository: ToolShedRepository) None[source]

Deactivate the supplied repository.

display_installed_jobs_list_page(installed_repository: ToolShedRepository, data_manager_names=None, strings_displayed=None) None[source]

If available, check data manager jobs for supplied strings.

installed_repository_extended_info(installed_repository: ToolShedRepository) Dict[str, Any][source]
install_repository(name: str, owner: str, changeset_revision: str, install_tool_dependencies: bool, install_repository_dependencies: bool, new_tool_panel_section_label: str | None)[source]
reactivate_repository(installed_repository: ToolShedRepository) None[source]
reset_metadata_on_installed_repositories(repositories: List[ToolShedRepository]) None[source]
uninstall_repository(installed_repository: ToolShedRepository) None[source]
update_installed_repository(installed_repository: ToolShedRepository, verify_no_updates: bool = False) Dict[str, Any][source]
reset_installed_repository_metadata(repository: ToolShedRepository) None[source]
property tool_data_path
property shed_tool_data_table_conf
get_tool_names() List[str][source]
get_installed_repository_by_name_owner(repository_name: str, repository_owner: str) ToolShedRepository[source]
get_installed_repositories_by_name_owner(repository_name: str, repository_owner: str) List[ToolShedRepository][source]
get_installed_repository_for(owner: str | None = None, name: str | None = None, changeset: str | None = None) Dict[str, Any] | None[source]
get_all_installed_repositories() List[ToolShedRepository][source]
refresh_tool_shed_repository(repo: ToolShedRepository) None[source]
class tool_shed.test.base.twilltestcase.StandaloneToolShedInstallationClient(testcase)[source]

Bases: ToolShedInstallationClient

__init__(testcase)[source]
setup() None[source]

Setup client interaction.

check_galaxy_repository_tool_panel_section(repository: ToolShedRepository, expected_tool_panel_section: str) None[source]
deactivate_repository(installed_repository: ToolShedRepository) None[source]

Deactivate the supplied repository.

display_installed_jobs_list_page(installed_repository: ToolShedRepository, data_manager_names=None, strings_displayed=None) None[source]

If available, check data manager jobs for supplied strings.

installed_repository_extended_info(installed_repository: ToolShedRepository) Dict[str, Any][source]
install_repository(name: str, owner: str, changeset_revision: str, install_tool_dependencies: bool, install_repository_dependencies: bool, new_tool_panel_section_label: str | None)[source]
reactivate_repository(installed_repository: ToolShedRepository) None[source]
reset_metadata_on_installed_repositories(repositories: List[ToolShedRepository]) None[source]
reset_installed_repository_metadata(repository: ToolShedRepository) None[source]
uninstall_repository(installed_repository: ToolShedRepository) None[source]
update_installed_repository(installed_repository: ToolShedRepository, verify_no_updates: bool = False) Dict[str, Any][source]
get_installed_repository_by_name_owner(repository_name: str, repository_owner: str) ToolShedRepository[source]
get_installed_repositories_by_name_owner(repository_name: str, repository_owner: str) List[ToolShedRepository][source]
get_installed_repository_for(owner: str | None = None, name: str | None = None, changeset: str | None = None) Dict[str, Any] | None[source]
get_all_installed_repositories() List[ToolShedRepository][source]
refresh_tool_shed_repository(repo: ToolShedRepository) None[source]
property shed_tool_data_table_conf
property tool_data_path
get_tool_names() List[str][source]
class tool_shed.test.base.twilltestcase.ShedTwillTestCase[source]

Bases: ShedApiTestCase

Class of FunctionalTestCase geared toward HTML interactions using the Twill library.

requires_galaxy: bool = False
setUp()[source]
inject_shed_browser(shed_browser: ShedBrowser)[source]
check_for_strings(strings_displayed=None, strings_not_displayed=None)[source]
check_page_for_string(patt)[source]

Looks for ‘patt’ in the current browser page

check_string_not_in_page(patt)[source]

Checks to make sure ‘patt’ is NOT in the page.

property invalid_tools_labels: str
create(cntrller: str = 'user', email: str = 'test@bx.psu.edu', password: str = 'testuser', username: str = 'admin-user', redirect: str | None = None) Tuple[bool, bool, bool][source]
last_page()[source]

Return the last visited page (usually HTML, but can binary data as well).

user_api_interactor(email='test@bx.psu.edu', password='testuser')[source]
user_populator(email='test@bx.psu.edu', password='testuser')[source]
login(email: str = 'test@bx.psu.edu', password: str = 'testuser', username: str = 'admin-user', redirect: str | None = None, logout_first: bool = True, explicit_logout: bool = False)[source]
property is_v2: bool
logout(explicit: bool = False)[source]

logout of the current tool shed session.

By default this is a logout if logged in action, however if explicit is True - ensure there is a session and be explicit in logging out to provide extract test structure.

submit_form(form_no=-1, button='runtool_btn', form=None, **kwd)[source]

Populates and submits a form from the keyword arguments.

join_url_and_params(url: str, params, query=None) str[source]
visit_url(url: str, params=None, allowed_codes: List[int] | None = None) str[source]
write_temp_file(content, suffix='.html')[source]
assign_admin_role(repository: Repository, user)[source]
browse_category(category: Category, strings_displayed=None, strings_not_displayed=None)[source]
browse_repository(repository: Repository, strings_displayed=None, strings_not_displayed=None)[source]
browse_repository_dependencies(strings_displayed=None, strings_not_displayed=None)[source]
browse_tool_shed(url, strings_displayed=None, strings_not_displayed=None)[source]
browse_tool_dependencies(strings_displayed=None, strings_not_displayed=None)[source]
browse_tools(strings_displayed=None, strings_not_displayed=None)[source]
check_count_of_metadata_revisions_associated_with_repository(repository: Repository, metadata_count: int)[source]
check_for_valid_tools(repository, strings_displayed=None, strings_not_displayed=None)[source]
check_galaxy_repository_db_status(repository_name, owner, expected_status)[source]
check_repository_changelog(repository: Repository, strings_displayed=None, strings_not_displayed=None)[source]
check_repository_dependency(repository: Repository, depends_on_repository: Repository, depends_on_changeset_revision=None, changeset_revision=None)[source]
check_repository_metadata(repository: Repository, tip_only=True)[source]
check_repository_tools_for_changeset_revision(repository: Repository, changeset_revision, tool_metadata_strings_displayed=None, tool_page_strings_displayed=None)[source]

Loop through each tool dictionary in the repository metadata associated with the received changeset_revision. For each of these, check for a tools attribute, and load the tool metadata page if it exists, then display that tool’s page.

check_repository_invalid_tools_for_changeset_revision(repository: Repository, changeset_revision, strings_displayed=None, strings_not_displayed=None)[source]

Load the invalid tool page for each invalid tool associated with this changeset revision and verify the received error messages.

check_string_count_in_page(pattern, min_count: int, max_count: int | None = None)[source]

Checks the number of ‘pattern’ occurrences in the current browser page

check_galaxy_repository_tool_panel_section(repository: ToolShedRepository, expected_tool_panel_section: str) None[source]
clone_repository(repository: Repository, destination_path: str) None[source]
commit_and_push(repository, hgrepo, options, username, password)[source]
create_category(**kwd) Category[source]
create_repository_dependency(repository: Repository, repository_tuples=None, filepath=None, prior_installation_required=False, complex=False, package=None, version=None, strings_displayed=None, strings_not_displayed=None)[source]
deactivate_repository(installed_repository: ToolShedRepository) None[source]
cloned_repo(repository: Repository) Iterator[str][source]
setup_freebayes_0010_repo(repository: Repository)[source]
add_file_to_repository(repository: Repository, source: str, target: str | None = None, strings_displayed=None, commit_message: str | None = None)[source]
add_tar_to_repository(repository: Repository, source: str, strings_displayed=None)[source]
commit_tar_to_repository(repository: Repository, source: str, commit_message=None, strings_displayed=None)[source]
delete_files_from_repository(repository: Repository, filenames: List[str])[source]
delete_repository(repository: Repository) None[source]
display_installed_jobs_list_page(installed_repository, data_manager_names=None, strings_displayed=None)[source]
display_installed_repository_manage_json(installed_repository)[source]
display_manage_repository_page(repository: Repository, changeset_revision=None, strings_displayed=None, strings_not_displayed=None)[source]
display_repository_clone_page(owner_name, repository_name, strings_displayed=None, strings_not_displayed=None)[source]
display_repository_file_contents(repository: Repository, filename, filepath=None, strings_displayed=None, strings_not_displayed=None)[source]

Find a file in the repository and display the contents.

edit_repository_categories(repository: Repository, categories_to_add: List[str], categories_to_remove: List[str], restore_original=True) None[source]
edit_repository_information(repository: Repository, revert=True, **kwd)[source]
enable_email_alerts(repository: Repository, strings_displayed=None, strings_not_displayed=None) None[source]
escape_html(string, unescape=False)[source]
expect_repo_created_strings(name)[source]
fetch_repository_metadata(repository: Repository, strings_displayed=None, strings_not_displayed=None)[source]
generate_complex_dependency_xml(filename, filepath, repository_tuples, package, version)[source]
generate_simple_dependency_xml(repository_tuples, filename, filepath, dependency_description='', complex=False, package=None, version=None, prior_installation_required=False)[source]
generate_temp_path(test_script_path, additional_paths=None)[source]
get_all_installed_repositories() List[ToolShedRepository][source]
get_filename(filename, filepath=None)[source]
get_hg_repo(path)[source]
get_repositories_category_api(categories: List[Category], strings_displayed=None, strings_not_displayed=None)[source]
get_or_create_repository(category: Category, owner: str, name: str, strings_displayed=None, strings_not_displayed=None, **kwd) Repository[source]
get_repo_path(repository: Repository) str[source]
get_repository_changelog_tuples(repository)[source]
get_repository_file_list(repository: Repository, base_path: str, current_path=None) List[str][source]

Recursively load repository folder contents and append them to a list. Similar to os.walk but via /repository/open_folder.

get_repository_metadata(repository: Repository)[source]
get_repository_metadata_for_db_object(repository: Repository)[source]
get_repository_metadata_by_changeset_revision(repository_id: int, changeset_revision)[source]
get_repository_metadata_revisions(repository: Repository) List[str][source]
get_repository_tip(repository: Repository) str[source]
get_repository_first_revision(repository: Repository) str[source]
get_tools_from_repository_metadata(repository, include_invalid=False)[source]

Get a list of valid and (optionally) invalid tool dicts from the repository metadata.

grant_role_to_user(user, role)[source]
grant_write_access(repository: Repository, usernames=None, strings_displayed=None, strings_not_displayed=None, post_submit_strings_displayed=None, post_submit_strings_not_displayed=None)[source]
load_citable_url(username, repository_name, changeset_revision, encoded_user_id, encoded_repository_id, strings_displayed=None, strings_not_displayed=None, strings_displayed_in_iframe=None, strings_not_displayed_in_iframe=None)[source]
load_changeset_in_tool_shed(repository_id, changeset_revision, strings_displayed=None, strings_not_displayed=None)[source]
load_checkable_revisions(strings_displayed=None, strings_not_displayed=None)[source]
load_display_tool_page(repository: Repository, tool_xml_path, changeset_revision, strings_displayed=None, strings_not_displayed=None)[source]
load_invalid_tool_page(repository: Repository, tool_xml, changeset_revision, strings_displayed=None, strings_not_displayed=None)[source]
preview_repository_in_tool_shed(name: str, owner: str, changeset_revision: str | None = None, strings_displayed=None, strings_not_displayed=None)[source]
reactivate_repository(installed_repository)[source]
reinstall_repository_api(installed_repository, install_repository_dependencies=True, install_tool_dependencies=False, new_tool_panel_section_label='')[source]
repository_is_new(repository: Repository) bool[source]
reset_metadata_on_selected_repositories(repository_ids)[source]
reset_metadata_on_installed_repositories(repositories)[source]
reset_repository_metadata(repository)[source]
revoke_write_access(repository, username)[source]
search_for_valid_tools(search_fields=None, exact_matches=False, strings_displayed=None, strings_not_displayed=None, from_galaxy=False)[source]
set_repository_deprecated(repository: Repository, set_deprecated=True, strings_displayed=None, strings_not_displayed=None)[source]
set_repository_malicious(repository: Repository, set_malicious=True, strings_displayed=None, strings_not_displayed=None) None[source]
tip_has_metadata(repository: Repository) bool[source]
undelete_repository(repository: Repository) None[source]
update_installed_repository(installed_repository: ToolShedRepository, verify_no_updates: bool = False) Dict[str, Any][source]
verify_installed_repositories(installed_repositories=None, uninstalled_repositories=None)[source]
verify_installed_repository_metadata_unchanged(name, owner)[source]
verify_installed_repository_no_tool_panel_section(repository)[source]

Verify that there is no ‘tool_panel_section’ entry in the repository metadata.

property shed_tool_data_table_conf
property tool_data_path
verify_installed_repository_data_table_entries(required_data_table_entries)[source]
verify_unchanged_repository_metadata(repository: Repository)[source]
pytestmark = [Mark(name='usefixtures', args=('shed_browser',), kwargs={})]
tool_shed.test.base.twilltestcase.get_installed_repository(session, name, owner, changeset)[source]