Skip to content

Commit

Permalink
do not allow codefiles for TS tool loading
Browse files Browse the repository at this point in the history
  • Loading branch information
martenson committed Feb 12, 2018
1 parent c5568a7 commit ba3b3d5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/tool_shed/tools/tool_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ def load_tool_from_config(self, repository_id, full_path):
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:
Expand Down
8 changes: 8 additions & 0 deletions test/unit/tools/test_tool_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit ba3b3d5

Please sign in to comment.