Permalink
Browse files

More isolated test_shed_upload.py tests.

They finally pass in the Jenkins container.
  • Loading branch information...
jmchilton committed May 25, 2018
1 parent 51e46d7 commit 72d2ca70600167bd44ceb2a7fa5c7cb688be83d5
Showing with 14 additions and 2 deletions.
  1. +14 −2 tests/test_shed_upload.py
@@ -3,6 +3,7 @@
Specifically, tests for shed_upload, shed_download, and shed_create.
commands.
"""
import contextlib
import os
import shutil
import tarfile
@@ -113,7 +114,7 @@ def test_update_with_force_create(self):

def test_tar_from_git(self):
with self._isolate() as f:
with modify_environ({"GIT_AUTHOR_NAME": "planemo developer", "EMAIL": "planemo@galaxyproject.org"}):
with self._git_configured():
dest = join(f, "single_tool")
self._copy_repo("single_tool", dest)
shell(" && ".join([
@@ -132,7 +133,7 @@ def test_tar_from_git(self):

def test_upload_from_git(self):
with self._isolate() as f:
with modify_environ({"GIT_AUTHOR_NAME": "planemo developer", "EMAIL": "planemo@galaxyproject.org"}):
with self._git_configured():
dest = join(f, "single_tool")
self._copy_repo("single_tool", dest)
shell(" && ".join([
@@ -156,6 +157,17 @@ def test_upload_from_git(self):
assert "repository https://github.com/galaxyproject" in message
assert rev in message

@contextlib.contextmanager
def _git_configured(self):
with modify_environ({
"GIT_AUTHOR_NAME": "planemo developer",
"GIT_COMMITTER_NAME": "planemo developer",
"EMAIL": "planemo@galaxyproject.org",
"GIT_AUTHOR_EMAIL": "planemo@galaxyproject.org",
"GIT_COMMITTER_EMAIL": "planemo@galaxyproject.org",
}):
yield

def test_create_and_upload(self):
with self._isolate_repo("single_tool") as f:
create_command = ["shed_create"]

0 comments on commit 72d2ca7

Please sign in to comment.