-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Doesn't yet bootstrap a shed - so following idiom should be used to test things with a manually configured shed on localhost:9009. TEST_TOOL_SHED_API_KEY=3dc803338b206156460d2bda85e6a1af nosetests tests/test_shed.py
- Loading branch information
Showing
3 changed files
with
69 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
""" | ||
""" | ||
|
||
import os | ||
import string | ||
import random | ||
|
||
from bioblend import toolshed | ||
|
||
from .test_utils import ( | ||
skip_unless_environ, | ||
CliTestCase, | ||
) | ||
|
||
from planemo.shed import username | ||
|
||
SHED_TEMPLATE = string.Template("""owner: ${owner} | ||
name: ${name} | ||
description: Planemo test repository. | ||
homepage_url: https://planemo.readthedocs.org/ | ||
remote_repository_url: https://github.com/galaxyproject/planemo/ | ||
type: tool_dependency_definition | ||
categories: | ||
- cooltools | ||
""") | ||
|
||
|
||
class ShedTestCase(CliTestCase): | ||
|
||
@skip_unless_environ("TEST_TOOL_SHED_API_KEY") | ||
def test_shed(self): | ||
shed_url = os.environ.get("TEST_TOOL_SHED_URL", "http://localhost:9009") | ||
shed_api_key = os.environ.get("TEST_TOOL_SHED_API_KEY") | ||
tsi = toolshed.ToolShedInstance(shed_url, key=shed_api_key) | ||
owner = username(tsi) | ||
with self._isolate(): | ||
shed_yml_contents = SHED_TEMPLATE.safe_substitute( | ||
owner=owner, | ||
name="planemotestrepo%d" % random.randint(0, 1000000), | ||
) | ||
open(".shed.yml", "w").write(shed_yml_contents) | ||
# init_cmd = ["shed_repo_create", "--shed_key", shed_api_key, "--shed_target", shed_url] | ||
# self._check_exit_code(init_cmd) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters