Skip to content

Commit 72d2ca7

Browse files
committed
More isolated test_shed_upload.py tests.
They finally pass in the Jenkins container.
1 parent 51e46d7 commit 72d2ca7

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

tests/test_shed_upload.py

+14-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Specifically, tests for shed_upload, shed_download, and shed_create.
44
commands.
55
"""
6+
import contextlib
67
import os
78
import shutil
89
import tarfile
@@ -113,7 +114,7 @@ def test_update_with_force_create(self):
113114

114115
def test_tar_from_git(self):
115116
with self._isolate() as f:
116-
with modify_environ({"GIT_AUTHOR_NAME": "planemo developer", "EMAIL": "[email protected]"}):
117+
with self._git_configured():
117118
dest = join(f, "single_tool")
118119
self._copy_repo("single_tool", dest)
119120
shell(" && ".join([
@@ -132,7 +133,7 @@ def test_tar_from_git(self):
132133

133134
def test_upload_from_git(self):
134135
with self._isolate() as f:
135-
with modify_environ({"GIT_AUTHOR_NAME": "planemo developer", "EMAIL": "[email protected]"}):
136+
with self._git_configured():
136137
dest = join(f, "single_tool")
137138
self._copy_repo("single_tool", dest)
138139
shell(" && ".join([
@@ -156,6 +157,17 @@ def test_upload_from_git(self):
156157
assert "repository https://github.com/galaxyproject" in message
157158
assert rev in message
158159

160+
@contextlib.contextmanager
161+
def _git_configured(self):
162+
with modify_environ({
163+
"GIT_AUTHOR_NAME": "planemo developer",
164+
"GIT_COMMITTER_NAME": "planemo developer",
165+
"EMAIL": "[email protected]",
166+
"GIT_AUTHOR_EMAIL": "[email protected]",
167+
"GIT_COMMITTER_EMAIL": "[email protected]",
168+
}):
169+
yield
170+
159171
def test_create_and_upload(self):
160172
with self._isolate_repo("single_tool") as f:
161173
create_command = ["shed_create"]

0 commit comments

Comments
 (0)