3
3
Specifically, tests for shed_upload, shed_download, and shed_create.
4
4
commands.
5
5
"""
6
+ import contextlib
6
7
import os
7
8
import shutil
8
9
import tarfile
@@ -113,7 +114,7 @@ def test_update_with_force_create(self):
113
114
114
115
def test_tar_from_git (self ):
115
116
with self ._isolate () as f :
116
- with modify_environ ({ "GIT_AUTHOR_NAME" : "planemo developer" , "EMAIL" : "[email protected] " } ):
117
+ with self . _git_configured ( ):
117
118
dest = join (f , "single_tool" )
118
119
self ._copy_repo ("single_tool" , dest )
119
120
shell (" && " .join ([
@@ -132,7 +133,7 @@ def test_tar_from_git(self):
132
133
133
134
def test_upload_from_git (self ):
134
135
with self ._isolate () as f :
135
- with modify_environ ({ "GIT_AUTHOR_NAME" : "planemo developer" , "EMAIL" : "[email protected] " } ):
136
+ with self . _git_configured ( ):
136
137
dest = join (f , "single_tool" )
137
138
self ._copy_repo ("single_tool" , dest )
138
139
shell (" && " .join ([
@@ -156,6 +157,17 @@ def test_upload_from_git(self):
156
157
assert "repository https://github.com/galaxyproject" in message
157
158
assert rev in message
158
159
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
+
166
+ "GIT_AUTHOR_EMAIL" :
"[email protected] " ,
167
+ "GIT_COMMITTER_EMAIL" :
"[email protected] " ,
168
+ }):
169
+ yield
170
+
159
171
def test_create_and_upload (self ):
160
172
with self ._isolate_repo ("single_tool" ) as f :
161
173
create_command = ["shed_create" ]
0 commit comments