tests/mockblackbox.py
author Gregory Szorc <gregory.szorc@gmail.com>
Fri, 28 Sep 2018 11:51:17 -0700
changeset 40007 1470183068b8
parent 37120 a8a902d7176e
child 43076 2372284d9457
permissions -rw-r--r--
storageutil: invert logic of file data comparison IMO things make more sense when the function is explicitly a test for file data equivalence. Not bothering with API since the function was introduced by the previous commit. Differential Revision: https://phab.mercurial-scm.org/D4802

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