tests/mockblackbox.py
author Augie Fackler <augie@google.com>
Thu, 24 Jan 2019 11:39:38 -0500
changeset 41333 671d5a712237
parent 37120 a8a902d7176e
child 43076 2372284d9457
permissions -rw-r--r--
py3: add missing b prefixes in test-acl.t There's one failure left in the test, which looks like a real problem around executing hooks. I have not investigated further. # skip-blame as just b'' prefixes Differential Revision: https://phab.mercurial-scm.org/D5677

from __future__ import absolute_import
from mercurial.utils import (
    procutil,
)

# XXX: we should probably offer a devel option to do this in blackbox directly
def getuser():
    return b'bob'
def getpid():
    return 5000

# mock the date and user apis so the output is always the same
def uisetup(ui):
    procutil.getuser = getuser
    procutil.getpid = getpid