tests/mockblackbox.py
author Joerg Sonnenberger <joerg@bec.de>
Mon, 29 Mar 2021 01:52:06 +0200
changeset 47055 d55b71393907
parent 43076 2372284d9457
child 48966 6000f5b25c9b
permissions -rw-r--r--
node: replace nullid and friends with nodeconstants class The introduction of 256bit hashes require changes to nullid and other constant magic values. Start pushing them down from repository and revlog where sensible. Differential Revision: https://phab.mercurial-scm.org/D9465

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