tests/mockblackbox.py
author Raphaël Gomès <rgomes@octobus.net>
Tue, 02 Jun 2020 17:24:37 +0200
changeset 44976 2093b2fc70d4
parent 43076 2372284d9457
child 48966 6000f5b25c9b
permissions -rw-r--r--
rust-dependencies: upgrade `micro-timer` dependency I wanted to to a tour of dependencies to upgrade, but only `micro-timer` has a new release which does not print when the function panics, which should be less misleading. Differential Revision: https://phab.mercurial-scm.org/D8605

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