Skip to content
Snippets Groups Projects
Commit e55c4457 authored by Georges Racinet's avatar Georges Racinet
Browse files

tests: moved switch_user method to a common utility module

As the docstring explains, this will help us somewhat with
uniformity or how user information is passed around.
parent 2a60f0cc
No related branches found
No related tags found
1 merge request!5check_write hook
Pipeline #
......@@ -8,6 +8,8 @@
LocalRepoWrapper,
)
from .utils import switch_user
def init_repo(basedir):
return LocalRepoWrapper.init(
......@@ -23,10 +25,6 @@
))
def switch_user(wrapper, user):
wrapper.repo.ui.environ['REMOTE_USER'] = user
def test_draft_publish(tmpdir):
wrapper = init_repo(tmpdir)
switch_user(wrapper, 'someone')
......
def switch_user(wrapper, user):
"""Common method to change the name of the acting user.
This helps enforcing that it works uniformly for all permission
related hooks.
"""
wrapper.repo.ui.environ['REMOTE_USER'] = user
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment