33Specifically, tests for shed_upload, shed_download, and shed_create.
44commands.
55"""
6+ import contextlib
67import os
78import shutil
89import 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+ 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