tests/mockblackbox.py
author Pulkit Goyal <7895pulkit@gmail.com>
Thu, 26 Mar 2020 14:01:31 +0530
changeset 44624 1bc345d488fd
parent 43076 2372284d9457
child 48966 6000f5b25c9b
permissions -rw-r--r--
tests: don't run test-update-atomic.t on chg I am unable to find a good way to make `showwrites` extension in it to work with chg. Also putting the use of showwrites inside `if no-chg` will defeat the purpose of test, so I just made the test no-op on chg.

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