tests/mockblackbox.py
author Gregory Szorc <gregory.szorc@gmail.com>
Thu, 07 Mar 2019 10:35:20 -0800
changeset 41912 d4bf73ea06de
parent 37120 a8a902d7176e
child 43076 2372284d9457
permissions -rw-r--r--
packaging: extract virtualenv and py2exe to build directory The build directory is essentially a cache. We can extract the virtualenv and py2exe package sources to this directory. Differential Revision: https://phab.mercurial-scm.org/D6088

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