From ba3b3d5c180e318c26c8db7f0dff7f26115554df Mon Sep 17 00:00:00 2001 From: Martin Cech Date: Mon, 12 Feb 2018 14:06:50 -0500 Subject: [PATCH] do not allow codefiles for TS tool loading --- lib/tool_shed/tools/tool_validator.py | 2 +- test/unit/tools/test_tool_validation.py | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/tool_shed/tools/tool_validator.py b/lib/tool_shed/tools/tool_validator.py index 0cf3485059f..43f2b7b4250 100644 --- a/lib/tool_shed/tools/tool_validator.py +++ b/lib/tool_shed/tools/tool_validator.py @@ -292,7 +292,7 @@ class ToolValidator(object): tool_location_fetcher=ToolLocationFetcher(), ) try: - tool = create_tool_from_source(config_file=full_path, app=self.app, tool_source=tool_source, repository_id=repository_id) + tool = create_tool_from_source(config_file=full_path, app=self.app, tool_source=tool_source, repository_id=repository_id, allow_code_files=False) valid = True error_message = None except KeyError as e: diff --git a/test/unit/tools/test_tool_validation.py b/test/unit/tools/test_tool_validation.py index 28f5cd211d7..57707de40f0 100644 --- a/test/unit/tools/test_tool_validation.py +++ b/test/unit/tools/test_tool_validation.py @@ -27,6 +27,14 @@ def test_validate_valid_tool(): assert message is None +def test_tool_validation_denies_allow_codefile(): + with get_tool_validator() as tv, setup_bismark() as repo_dir: + full_path = os.path.join(repo_dir, 'bismark_methylation_extractor.xml') + tool, valid, message = tv.load_tool_from_config(repository_id=None, + full_path=full_path) + assert tool._allow_code_files is False + + def test_validate_tool_without_index(): with get_tool_validator() as tv, setup_bismark() as repo_dir: full_path = os.path.join(repo_dir, 'bismark_bowtie2_wrapper.xml')