How to use planemo - 10 common examples

To help you get started, we’ve selected a few planemo examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github galaxyproject / planemo / tests / test_shed_upload.py View on Github external
def test_tar_from_git(self):
        with self._isolate() as f:
            with self._git_configured():
                dest = join(f, "single_tool")
                self._copy_repo("single_tool", dest)
                shell(" && ".join([
                    "cd %s" % dest,
                    "git init",
                    "git add .",
                    "git commit -m 'initial commit'"
                ]))
                upload_command = [
                    "shed_update", "--force_repository_creation",
                    "git+single_tool/.git"
                ]
                upload_command.extend(self._shed_args())
                self._check_exit_code(upload_command)
                self._verify_single_uploaded(f, ["single_tool"])
github galaxyproject / planemo / planemo / commands / cmd_test_reports.py View on Github external
def cli(ctx, path, **kwds):
    """Generate human readable tool test reports.

    Creates reports in various formats  (HTML, text, markdown)
    from the structured test output (tool_test_output.json).
    """
    if not os.path.exists(path):
        io.error("Failed to tool test json file at %s" % path)
        return 1

    test_data = StructuredData(path)
    test_data.calculate_summary_data_if_needed()
    handle_reports(ctx, test_data.structured_data, kwds)
github galaxyproject / planemo / planemo / galaxy_test / actions.py View on Github external
):
    num_tests = test_results.num_tests
    num_problems = test_results.num_problems

    if num_tests == 0:
        warn(NO_TESTS_MESSAGE)
        return

    if num_problems == 0:
        info(ALL_TESTS_PASSED_MESSAGE % num_tests)

    if num_problems:
        html_report_file = test_results.output_html_path
        message_args = (num_problems, num_tests, html_report_file)
        message = PROBLEM_COUNT_MESSAGE % message_args
        warn(message)

    for testcase_el in test_results.xunit_testcase_elements:
        structured_data_tests = test_results.structured_data_tests
        __summarize_test_case(structured_data_tests, testcase_el, **kwds)
github galaxyproject / planemo / planemo / galaxy_test / actions.py View on Github external
def __handle_summary(
    test_results,
    **kwds
):
    summary_style = kwds.get("summary")
    if summary_style == "none":
        return

    if test_results.has_details:
        __summarize_tests_full(
            test_results,
            **kwds
        )
    else:
        if test_results.exit_code:
            warn(GENERIC_PROBLEMS_MESSAGE % test_results.output_html_path)
        else:
            info(GENERIC_TESTS_PASSED_MESSAGE)
github galaxyproject / planemo / planemo / galaxy_test / actions.py View on Github external
def __summarize_tests_full(
    test_results,
    **kwds
):
    num_tests = test_results.num_tests
    num_problems = test_results.num_problems

    if num_tests == 0:
        warn(NO_TESTS_MESSAGE)
        return

    if num_problems == 0:
        info(ALL_TESTS_PASSED_MESSAGE % num_tests)

    if num_problems:
        html_report_file = test_results.output_html_path
        message_args = (num_problems, num_tests, html_report_file)
        message = PROBLEM_COUNT_MESSAGE % message_args
        warn(message)

    for testcase_el in test_results.xunit_testcase_elements:
        structured_data_tests = test_results.structured_data_tests
        __summarize_test_case(structured_data_tests, testcase_el, **kwds)
github galaxyproject / planemo / tests / test_shed_diff.py View on Github external
def test_shed_diff(self):
        with self._isolate_repo("single_tool") as f:
            upload_command = ["shed_upload", "--force_repository_creation"]
            upload_command.extend(self._shed_args())
            self._check_exit_code(upload_command)
            io.write_file(
                join(f, "related_file"),
                "A related non-tool file (modified).\n",
            )
            self._check_diff(f, True)
            self._check_diff(f, False)
github galaxyproject / planemo / tests / test_shed_diff.py View on Github external
def test_diff_recursive(self):
        with self._isolate_repo("multi_repos_nested") as f:
            self._shed_create(recursive=True)

            diff_command = ["shed_diff", "-r"]
            diff_command.extend(self._shed_args(read_only=True))
            self._check_exit_code(diff_command, exit_code=0)

            io.write_file(
                join(f, "cat1", "related_file"),
                "A related non-tool file (modified).\n",
            )
            self._check_exit_code(diff_command, exit_code=1)
github galaxyproject / planemo / tests / test_utils.py View on Github external
def _copy_repo(self, name, dest):
        repo = os.path.join(TEST_REPOS_DIR, name)
        io.shell(['cp', '-r', "%s/." % repo, dest])
github galaxyproject / planemo / tests / test_shed_expansion.py View on Github external
def _repos(self, **kwds):
        return shed.build_effective_repositories(self.temp_directory, **kwds)
github galaxyproject / planemo / tests / test_training_tool_input.py View on Github external
def test_ToolInput_get_formatted_repeat_desc():
    """Test :func:`planemo.training.tool_input.ToolInput.get_formatted_repeat_desc`."""
    tool_input = ToolInput(
        tool_inp_desc=tool_inp_desc[2],
        wf_param_values=wf_param_values,
        wf_steps=wf_steps,
        level=1,
        should_be_there=True,
        force_default=False)
    repeat_desc = tool_input.get_formatted_repeat_desc()
    assert '>    - In *"' in repeat_desc
    assert '>        - {% icon param-repeat %} *"Insert' in repeat_desc
    assert '>            -' in repeat_desc