tests/mockblackbox.py
author Matt Harbison <matt_harbison@yahoo.com>
Wed, 26 Sep 2018 20:49:28 -0400
changeset 39882 c841e8855cd3
parent 37120 a8a902d7176e
child 43076 2372284d9457
permissions -rw-r--r--
py3: replace a StandardError reference This doesn't exist on py3, and the standard way of handling this seems to be to catch both exceptions.

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